0

Okay, I have multiple domains on my server. They have vhost conf files. my main domain.. www.example.com has config file such as..

    ServerAdmin [email protected]
    ServerName example.net
    ServerAlias www.example.net
    DocumentRoot /var/www/example.net/public_html

I have 2 files for it.. 80 and 443 for SSL

Now the issue is this.. When I type in a browser www.example.com it takes me to root folder of domain instead of site folder root that's in the path.

when I type example.com into the browser it takes me to the correct root. I can not find this issue anywhere or how to solve i've tried everything I can think of.

3 Answers 3

0

You might have another VirtualHost that matches the www.example.com and appears before in the configuration. That configuration would be used, instead.

A very common mistake is omitting ServerName in the default (or any) virtualhost. If no ServerName is specified, the server attempts to deduce it from the server's IP address, and this may result in www.example.com, making it unintuitively the first matching virtualhost instead of the one actually having it as a ServerName or in ServerAlias.

0

need to verify the virtual host configuration for domain example.com.

ServerName example.com

ServerAlias www.example.com

DocumentRoot /var/www/example.com/public_html

0

It might be due to file names of the conf. Add 0-{yourfile}.conf, 1-{yourfile}.conf etc. Just add a prefix of the order number to each file. Apache execute that way so.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .