Virtual host www.domain.com work, domain.com don't work
Hi, i'm having a problem with a virtual host. Well actually all of them. When someone try to access for example www.domain.com it works great, my server act as the virtual host of that domain. But if someone try to access domain.com my server doesn't act as it's virtual host and just redirect it to "/".
I hope someone could help me to solve this. Here is the virtual host conf Code:
NameVirtualHost *:80 Code:
$TTL 86400 |
Try adding "ServerAlias mydomain.com" to your virtual definition.
|
Hello
In the configuration of virtual hosting,try adding the domain name mydomain.com. ie.. NameVirtualHost *:80 <VirtualHost *:80> ServerName www.domain.com domain.com DocumentRoot "/var/www/domain.com" </VirtualHost> Got it? I hope this works. Thanks, |
Yes i tried this, but got this error
Code:
ServerName takes one argument, The hostname and port of the server |
Hello stormrider_may,
Really sorry to say that, I was not in my senses, i think. You must add 'ServerAlias' not 'ServerName'. ie.. NameVirtualHost *:80 <VirtualHost *:80> ServerAlias www.domain.com domain.com DocumentRoot "/var/www/domain.com" </VirtualHost> Thanks,, |
All times are GMT -5. The time now is 11:36 AM. |