#下面是虚拟目录声明格式 #Alias用来定义虚拟目录及虚拟目录路径,其中虚拟目录名称用于URL访问的路径别名,可以和虚拟目录名称不同 #<Directory/>节点用于定义目录的访问权限等 # #Alias 虚拟目录名称 虚拟目录路径 #<Directory 虚拟目录路径> # Options Indexes FollowSymLinks # AllowOverride All # Order allow,deny # Allow from all #</Directory> #下面是具体的示例,/DemoSite是目录别名 "D:/Code/WebSite"是虚拟目录的实际路径 Alias /DemoSite "D:/Code/WebSite" <Directory "D:/Code/WebSite"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory>
<IfModule alias_module>
#
# Redirect: Allows you to tell clients about documents that used to
# exist in your server's namespace, but do not anymore. The client
# will make a new request for the document at its new location.
# Example:
# Redirect permanent /foo http://localhost/bar
#
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Example:
# Alias /webpath /full/filesystem/path
#
# If you include a trailing / on /webpath then the server will
# require it to be present in the URL. You will also likely
# need to provide a <Directory> section to allow access to
# the filesystem path.
#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#
ScriptAlias /cgi-bin/ "D:/Program Files/Apache2.2/cgi-bin/"
Alias /DemoSite "D:/Code/WebSite"
<Directory "D:/Code/WebSite">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</IfModule>
#多主机头配置无需放在特定的节点下面,一般直接在配置文件底部添加即可 #NameVirtualHost addr[:port] 为一个基于域名的虚拟主机指定一个IP地址(和端口) #声明主机头必须加这条指令,否者主机头配置不会生效 #VirtualHost节点下面ServerName就是要绑定的域名,DocumentRoot表示此域名指向的目录 #本机测试的话请在hosts中进行域名绑定如 127.0.0.1 www.mysite1.com NameVirtualHost *:8080 <VirtualHost *:8080> ServerName www.mysite1.com DocumentRoot "D:Program FilesApache2.2htdocs" </VirtualHost> <VirtualHost *:8080> ServerName www.mysite2.com DocumentRoot "D:CodeMySite" </VirtualHost>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有