I do this with redirect by placing a RedirectMatch statement in
www.xxx.com's Virtual Host configuration file on debian, or just in
that Virtual Host's section of httpd.conf on other systems:
RedirectMatch ^/.*
http://www.yyy.com/
Works like a charm
scott.tieds@gmail.com wrote:
> My site currently has 2 domains registered. I would like to forward
> all traffic from one domain to the other. For example, my site is
> registered as both www.xxx.com and www.yyy.com, and I would like all
> users who visit www.xxx.com to be automatically redirected to
> www.yyy.com. I placed a .htaccess file in the document root containing
> only the following:
>
> RewriteEngine On
> RewriteCond %{HTTP_HOST} ^www.xxx.com$ [NC]
> RewriteRule ^(.*)$ http://www.yyy.com/$1 [R=301,L]
>
> however, I get a "Forbidden" error upon visiting either xxx.com or
> yyy.com after restarting apache. Any suggestions?