httpd-users mailing list archives

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

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

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

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

John C. Nichel

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message