How can I redirect all traffic from one domain to another with an .htaccess file?

Posted by George Edison on Stack Overflow See other posts from Stack Overflow or by George Edison
Published on 2010-03-24T06:11:11Z Indexed on 2010/03/24 6:13 UTC
Read the original article Hit count: 209

Filed under:
|

Say I have a subdomain xxx.yyy.com running Apache. The files are stored in /home/someone/public_html/xxx.

What I want to do is redirect all requests to a domain name zzz.com which is using the same location for its files. (In other words, xxx.yyy.com and zzz.com are aliases for each other)

I just want people accessing zzz.com, so if someone goes to xxx.yyy.com they should be redirected to zzz.com.

Can this easily be done with a rewrite rule in an .htaccess file?

© Stack Overflow or respective owner

Related posts about apache

Related posts about .htaccess