MAMP VirtualHost在Windows上不起作用

问题描述 投票:0回答:1

我正在尝试在MAMP Windows上设置VitualHost,但是它不起作用。正在加载2-3秒,然后显示Can't access this website

这是我的配置:

  • httpd.conf
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
  • 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端口上。

这里怎么了?

谢谢!

apache mamp virtualhost
1个回答
0
投票

在c:\ Windows \ System32 \ Drivers \ etc \ hosts中添加以下代码

127.0.0.1 project.local
127.0.0.1 www.project.local

重新启动Apache。

© www.soinside.com 2019 - 2024. All rights reserved.