|
|
|
|
||||||
| alt.apache.configuration Apache web server configuration issues. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 (permalink) |
|
Messages: n/a
Hébergeur: |
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? |
|
|
|
#2 (permalink) |
|
Messages: n/a
Hébergeur: |
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? |
|
![]() |
| Outils de la discussion | |
|
|