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

Possible Duplicate:
third level domain and debian

How can I go about having another alias for my web address, what i mean is, if to get to a website on my centos server i can go to domain.com for example, how can i make it so something like x.domain.com will also work as an address to my website, i want to use a VirtualHost to later make that second address land on a different index page...any help is appriciated



share|improve this question

marked as duplicate by EEAA, voretaq7 Dec 3 '12 at 3:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

@lain where can I check how to change the DNS settings so x.domain.com resolves to my server? –  Daniel Dec 3 '12 at 0:59
That would very much depend on how your DNS is managed. –  Iain Dec 3 '12 at 11:39

1 Answer 1

up vote 2 down vote accepted

For the time being, you can use the 'ServerAlias' directive in your current VirtualHost configuration.

<VirtualHost *:80>
    ServerName domain.com
    ServerAlias x.domain.com
    DocumentRoot /path/to/web/dir

Then later on, you can configure a new VirtualHost for x.domain.com to point to a new documentroot.

share|improve this answer

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