Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a demo.domain.com and domain.com they both show the same information and point to the same folder.

How can I redirect all demo.domain.com visitors to domain.com?

share|improve this question
1  
I see the htaccess tag, but you should specify your HTTPD so no one assumes. –  Tim Jul 17 '12 at 20:03
    
There is a complete answer on stack overflow about this. Look [here][1]. [1]: stackoverflow.com/questions/2597474/… –  MahmutBulut Jul 17 '12 at 20:16
add comment

1 Answer

up vote 4 down vote accepted

Assuming the HTTPD is apache:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^demo\.* [NC]
RewriteRule .* http://domain.com/ [L]
share|improve this answer
add comment

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.