我正在尝试在MAMP Windows上设置VitualHost,但是它不起作用。正在加载2-3秒,然后显示Can't access this website
。
这是我的配置:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot C:\MAMP\htdocs\website
ServerName project.local
ServerAlias www.project.local
<Directory "C:\MAMP\htdocs\website">
Allow from All
AllowOverride all
Options -Indexes +FollowSymlinks
</Directory>
UseCanonicalName on
</VirtualHost>
Apache在80端口上。
这里怎么了?
谢谢!
在c:\ Windows \ System32 \ Drivers \ etc \ hosts中添加以下代码
127.0.0.1 project.local
127.0.0.1 www.project.local
重新启动Apache。