2

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.

2
  • 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
3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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