Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've assigned a virtual host for the domain www.website.com on my hosting.

<VirtualHost *:80>
    DocumentRoot /var/www/sites/mywebsite
    ServerName www.website.com
</VirtualHost>

Now I've just realized that "website.com" is not forwarded to the correct path. Should I add a new virtualhost for it ? Or add a new ServerName parameter ? (it's the same path)

share|improve this question

2 Answers 2

up vote 2 down vote accepted

The simplest way is to add a ServerAlias.

<VirtualHost *>
ServerName www.domain.com
ServerAlias domain.com
# ...
</VirtualHost> 
share|improve this answer

first of all you have to make sure that in your DNS configuration you point to the right server address because if i am not misunderstanding from your case, that you actually can create point different machine for 1. website.com - f.e point to 192.168.1.1 2. www.website.com - f.e point to 192.168.1.2

share|improve this answer

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.