httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Drew Tomlinson <>
Subject [users@httpd] Trouble With mod_rewrite
Date Mon, 15 Sep 2008 22:46:56 GMT
I'm using Apache version 2.2.6 with dynamic modules.  I'm trying to use 
mod_rewrite to change a URL.  Specifically, if someone enters:

I want to redirect him and make his browser window show:

Both domains resolve to the same IP address. 

I've Googled and found many examples that describe this very exact 
scenario but I have been unable to make it work.  Specifically, I've 
added these lines to my conf file:

# Added Rewrite rule to change
# Taken from example at
RewriteEngine on
RewriteCond %{HTTP_HOST}   !^www\.consumer-sc\.ca\.gov$ [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteRule ^/(.*)$1 [L,R=301]

After restarting the web server, connections to do not get rewritten.  The page is served 
exactly as if there was no mod_rewrite.

Connections to receive a "Moved 
Permanently - The document has moved here." message with "here" being a 
link to

I'm sure I'm missing something simple.  Would someone please hit me with 
a clue stick?



Be a Great Magician!
Visit The Alchemist's Warehouse

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