3

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?

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Andrew
  • 451
  • 2
  • 4
  • 9
  • 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]: http://stackoverflow.com/questions/2597474/use-htaccess-to-redirect-all-traffic-from-subdomain-to-domain-without-maintainin?answertab=active#tab-top – MahmutBulut Jul 17 '12 at 20:16

1 Answers1

4

Assuming the HTTPD is apache:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^demo\.* [NC]
RewriteRule .* http://domain.com/ [L]
Tim
  • 6,113
  • 1
  • 18
  • 19