Mobile app version of vmapp.org
Login or Join
Cooney921

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

@Cooney921

Posted in: #Apache #Domains #Subdomain

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

DocumentRoot "D:wwwtuniguide"

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:wwwtuniguidefr"

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.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Cooney921

1 Comments

Sorted by latest first Latest Oldest Best

 

@Tiffany637

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:wwwtuniguide"
ServerName tuniguide.local

# Other directives here
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "D:wwwtuniguidefr"
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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme