Sacha COHEN
Sacha COHEN

Reputation: 52

MAMP VirtualHost is not working on Windows

I am trying to set VitualHost on MAMP Windows but it's not working. It's loading for 2-3 seconds and then showing Can't access this website.

Here is my configuration:

# 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 is on 80 port.

What's wrong here ?

Thanks !

Upvotes: 0

Views: 147

Answers (1)

Puneet Chandhok
Puneet Chandhok

Reputation: 422

Add following code in c:\Windows\System32\Drivers\etc\hosts

127.0.0.1 project.local
127.0.0.1 www.project.local

restart apache.

Upvotes: 1

Related Questions