
Estoy intentando redirigir desde un nombre de host antiguo al nuevo. hasta ahora tengo
RewriteEngine On
RewriteCond %{HTTP_HOST} ^foo$ [NC,OR]
RewriteCond %{HTTP_HOST} ^foo.company.com$ [NC]
RewriteRule ^(.*) http://bar.company.com/$1 [R=301]
pero cuando voy a foo.company.com/dir/page.html
no me redirigen. ¿Qué estoy haciendo mal?
Respuesta1
Resulta que un incidente misterioso provocó que tres servidores se reiniciaran, incluido el antiguo foo.company.com
, volvió a su antigua IP y estaba luchando por ella con el nuevo servidor.
Hice funcionar mis reglas y las perfeccioné para:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^foo$ [OR]
RewriteCond %{HTTP_HOST} ^foo.company.com$
RewriteRule ^/?(.*)$ http://bar.company.com/$1 [R=301]