Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ccwq/e302cc0198f77c542f12 to your computer and use it in GitHub Desktop.
Save ccwq/e302cc0198f77c542f12 to your computer and use it in GitHub Desktop.
Apache或者xmapp配置域名并跳转到特定目录
Apache或者xmapp配置域名并跳转到特定目录
1.在/conf/extra/httpd-vhosts.conf中(或者直接写到httpd.conf)增加
<VirtualHost *:80>
DocumentRoot "E:/http/sanyou_cc"
ServerName "sanyou.cc"
</VirtualHost>
可以参考42行之前的举例,这里需要注意的是,apache的配置,不能用tab,不然会报错
如果端口好不为80可以在httpd.conf中增加
Listen 80
Listen 88
2.在httpd.conf中搜索Director修改其内容
<Directory />
#AllowOverride none
#Require all denied
Order deny,allow
Deny from allow
</Directory>
此项是为了防止出现错误:xampp Apache Access forbidden! Error 403
 
3.修改host文件。增加
127.0.0.1 sanyou.cc
4.重启或者开启apache
php不支持中文目录(虚拟目录或者virtualhost)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment