Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm working on WampServer for development, I've set up the domain tuniguide.local and it works fine with this configuration:

DocumentRoot "D:\www\tuniguide"

ServerName tuniguide.local

But when I wanted to add a subdomain fr.tuniguide.local I get a 404 Not Found with this configuration:

DocumentRoot "D:\www\tuniguide\fr"

ServerName fr.tuniguide.local

It gives me this message: The requested URL /www/tuniguide/index.php was not found on this server.

Is there someting that I missed?

Thanks.

share|improve this question
1  
I think i can check and tell you –  user6140 Mar 17 '11 at 11:12
    
weird that your documentroot and URL's have the same prefix. Try reading your errorlog and re-checking the filesystem –  covener Feb 25 '12 at 14:31
add comment

1 Answer

I think Virtual Hosts and updating your hosts file would help in this case. In your server config file, you'll want to make sure it's turned on for your port with this line:

NameVirtualHost *:80

Then you want to specify each virtual host:

<VirtualHost *:80>
  DocumentRoot "D:\www\tuniguide"
  ServerName tuniguide.local

  # Other directives here
</VirtualHost>

<VirtualHost *:80>
  DocumentRoot "D:\www\tuniguide\fr"
  ServerName fr.tuniguide.local

  # Other directives here
</VirtualHost>

Then finally you'll want to update your host file to include something like this:

127.0.0.1 tuniguide.local
127.0.0.1 fr.tuniguide.local

Note: Be sure to restart Apache after you've updated both the config and hosts file.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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