httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Nichel <j...@kegworks.com>
Subject [users@httpd] mod_rewrite to rewrite host name
Date Tue, 21 Sep 2004 15:04:50 GMT
Hi,

   I'm trying to do a 301 redirect to all traffic coming to on FQDN to 
another....

RewriteEngine On
RewriteCond %{HTTP_HOST}   !^test\.kegworks\.com [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^/(.*)         http://www.kegworks.com:%{SERVER_PORT}/$1 
[QSA,R=301][OR]
RewriteCond %{HTTP_HOST}   !^test.kegworks.com [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteRule ^/(.*)         http://www.kegworks.com/$1 [QSA,R=301]

Basically, I want to send all 'test.kegworks.com' traffic to 
'www.kegworks.com', with the path (and any query strings) in tact. 
However, with the above ruleset in place, any URL I click on for 
test.kegworks.com goes to test.kegworks.com, with no redirect at all. 
I'm sure I'm missing something simple, but I just can't see it.  TIA

-- 
John C. Nichel
KegWorks.com
716.856.9675
john@kegworks.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message