Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a server running ubuntu, with a domain's A record point to it.

I want to setup, to redirect to

What I should install to make that work?

share|improve this question
up vote 1 down vote accepted

Subdomains are done through DNS, however, the manipulation you are talking about will involve both DNS trickery and configuration of your web server. You will need to point to as a CNAME record as a first step. Once that is complete, you will need to create rewrite rules using mod_rewrite (if you are using Apache) to forward the subdomain to the argument to the jsp file.

share|improve this answer

Create CNAME or A record:        CNAME        CNAME

Configure Apache 2(mod_rewrite):

RewriteCond %{HTTP_HOST}   ^aa\.bc\.com$ [NC]
RewriteRule ^/(.*) [L,R]

RewriteCond %{HTTP_HOST}   ^cc\.bc\.com$ [NC]
RewriteRule ^/(.*) [L,R]
share|improve this answer

Your Answer


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.