linux apache 域名添加虚拟目录 配置虚拟目录 一个站点配置多个虚拟目录访问

网站二级域名配置物理路径,配置访问网站的根目录下的文件如:js,css,images等

         

   # 访问物理路径配置                                                                     
    DocumentRoot "D:/public_html/m"                                     
    ServerName m.tj.cn                                                                              
                                              
        Options Indexes FollowSymLinks                                                               
        AllowOverride All                                                                            
        Order allow,deny                                                                             
        Allow from all                                                                               
   
     

   #其中images 是虚拟目录名,D:/public_html/images为物理路径名。
    Alias /images "D:/public_html/images"
   
        Options Indexes FollowSymLinks                                                               
        AllowOverride All                                                                            
        Order allow,deny                                                                             
        Allow from all
   
    

    #其中css 是虚拟目录名,D:/public_html/css 为物理路径名。
    Alias /css "D:/public_html/css"
   
        Options Indexes FollowSymLinks                                                               
        AllowOverride All                                                                            
        Order allow,deny                                                                             
        Allow from all
   

#其中js 是虚拟目录名,D:/public_html/js 为物理路径名。
    Alias /js "D:/public_html/js"
   
        Options Indexes FollowSymLinks                                                               
        AllowOverride All                                                                            
        Order allow,deny                                                                             
        Allow from all
   
 

#其中img 是虚拟目录名,D:/public_html/img 为物理路径名。
    Alias /img "D:/public_html/img"
   
        Options Indexes FollowSymLinks                                                               
        AllowOverride All                                                                            
        Order allow,deny                                                                             
        Allow from all
   
 

感觉配置的虚拟目录写的太过繁琐,不知还有没有简便的写法,有知道其他写法的还请留言告知,大家多多交流,感谢!!

你可能感兴趣的:(linux apache 域名添加虚拟目录 配置虚拟目录 一个站点配置多个虚拟目录访问)