PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > alt.apache.configuration > Using .htaccess to redirect from one domain to another
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
alt.apache.configuration Apache web server configuration issues.

Using .htaccess to redirect from one domain to another

Réponse
 
LinkBack Outils de la discussion
Vieux 28/09/2006, 14h32   #1 (permalink)
scott.tieds@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Using .htaccess to redirect from one domain to another

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?

  Réponse avec citation
Vieux 28/09/2006, 19h14   #2 (permalink)
fraz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Using .htaccess to redirect from one domain to another

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?


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 01h49.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,06947 seconds with 10 queries