我已经复习了一些关于这个问题的答案,但没有任何帮助。我试图在XAMPP中设置多个虚拟主机,但是一旦我在浏览器中键入服务器别名,它就会将我重定向到XAMPP/仪表板。请你看看下面的代码,并分享你的想法。提前谢谢。
httpd-vhosts.conf文件
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/"
ServerName localhost
</VirtualHost>
<VirtualHost test*:80>
DocumentRoot "E:/Drive/Dev/test"
ServerName test
ServerAlias test
<Directory "E:/Drive/Dev/test">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>httpd.conf文件
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
DocumentRoot "C:/xampp/htdocs/"
<Directory "C:/xampp/htdocs/">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>主机文件
127.0.0.1 test发布于 2016-03-26 22:48:04
更改“目录”标记中的以下行
Order allow,deny
Allow from all在这里面
Require all granted解决这个问题。
https://stackoverflow.com/questions/36241277
复制相似问题