Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

This question already has an answer here:

I have problem about setting new project. I just installed wamp 2.2E. I am using windows XP. In folder /www I created folder /example. In WINDOWS/system32/drivers/etc/hosts I added

and in G:\wamp\bin\apache\apache2.2.22\conf\extra\httpd-vhosts.conf added at the end

   DocumentRoot "G:/wamp/www/example"

   <Directory "G:/wamp/www/example">
      Options Indexes FollowSymLinks ExecCGI Includes
      AllowOverride All
      Order allow,deny
      Allow from All

The problem is when I go to I still get content from www/index.php instead of www/example/index.php. Did I miss anything?

share|improve this question

migrated from Aug 22 '12 at 6:31

This question came from our site for professional and enthusiast programmers.

marked as duplicate by HopelessN00b Feb 25 at 7:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Maybe this question is better suited to Pro Webmasters? – adamjansch Aug 21 '12 at 10:36

3 Answers 3

up vote 1 down vote accepted

May be you did not restart your apache server after that changes ?

so here is one of my own vhost :

at first you need to add, in the httpd-vhosts.conf, in the beginning of the file :

NameVirtualHost *:80 

then the vhost definition itself :

<VirtualHost *:80>
DocumentRoot "C:/WEB/DOCUMENT_ROOT/www_foxmask/www/"
ServerName foxmask.localhost

<Directory "C:/WEB/DOCUMENT_ROOT/www_foxmask/www/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order Deny,Allow
    Deny from all
    Allow from

CustomLog "C:\WEB\DOCUMENT_ROOT\apache_logs\www_foxmask.log" common
ErrorLog  "C:\WEB\DOCUMENT_ROOT\apache_logs\www_foxmask-error.log"

nota : in your httpd.conf you should have this line to make the httpd-vhosts.conf works correctly :

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

the path to the file depends on your you installation

hope this could help

share|improve this answer
I did. I am not sure if this is windows host problem or apache. – user1324762 Aug 20 '12 at 14:02
I added one example of my own setup with wampserver 2.0 – FoxMaSk Aug 20 '12 at 19:47

The problem was because I missed one step. In the file: G:\wamp\bin\apache\Apache2.2.22\conf\httpd.conf Find: #Include conf/extra/httpd-vhosts.conf and delete the #

share|improve this answer
that's what i said in my last comment .... – FoxMaSk Aug 21 '12 at 19:50
it should be nice if you could accept one answer at least – user133014 Aug 24 '12 at 22:36
You added example after I added this answer. But anyway I just accepted your answer. – user1324762 Aug 27 '12 at 18:19

Try VirtualHost *:80

the DNS Name is taken by ServerAlias as far as i know.

if you have an ServerAlias with only * as wildcard, set your before the * entry.

share|improve this answer
I also thought that, but it is not. I removed, restarted this line and still the same. I also copied file from previous installation which worked ok, but still it opend www/index.php instead of www/example/index.php – user1324762 Aug 20 '12 at 14:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.