1
votes

I have a problem in creating my virtual using WampServer. In the office I can create and run a virtualhost properly. But when I tries to create in my laptop. I t redirects to the localhost page of my wampserver. It displays the default page of wampserver. Here's what I did.

First I move my project in this directory: - C:\Users\jerielle0214\Documents\Chelle\hallohalloalliance

Second is I add the virtual host in apache (C:\wamp\bin\apache\apache2.2.22\conf\extra\httpd-vhosts.conf)

<VirtualHost *:80>
    ServerName chelle.hallohalloalliance.com
    ServerAlias chelle.hallohalloalliance.com
    DocumentRoot "C:/Users/jerielle0214/Documents/Chelle/hallohalloalliance/"
    <Directory "C:/Users/jerielle0214/Documents/Chelle/hallohalloalliance/">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all    
    </Directory>
</VirtualHost>

And I include my virtualhost in the Windows hosts file. I add this in the bottom of the hosts file

 127.0.0.1       chelle.hallohalloalliance.com

Last I restarted the wampserver and I access my page using chelle.hallohalloalliance.com but it only redirect my page to default wamp page. I don't know where's the error. Please help me guys thanks.

1

1 Answers

1
votes

Apache will fallback to the first host it was correctly told about when there is a problem with your VHOST definitions.

Did you uncomment this line in the httpd.conf file so Apache includes your vhost definition?

#Include conf/extra/httpd-vhosts.conf

just remove the #.

Also when you change the hosts file you need to reboot or refresh the DNS Cache for the changes to be visible to windows. To refresh the cache do this from a command window ( run as Administrator )

net stop "DNS Client"
net start "DNS Client"