View Full Version : RewriteRule ^/$ redirects instead of masks the URI

04-15-2005, 09:42 PM
I've got a .htaccess file with a bunch of Rewrite rules for my website (http://jero.net). It works perfectly except for the index page. Whenever you go to http://jero.net/ it redirects the URI to http://www.jero.net/archive/ (where my WordPress is installed). But when I go to http://jero.net/about/, it displays the content of http://jero.net/archives/about/ but the URI remains http://jero.net/about/, unlike http://jero.net/ does. Here is my .htaccess:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.jero\.net$ [NC]
RewriteRule ^(.*)$ http://jero.net/$1 [R=301,L]

RewriteRule ^index.html$ /archive
RewriteRule ^(archives|projects|about|contact|portfolio|services)$ /archive/$1
RewriteRule ^(archives|projects|about|contact|portfolio|services)/$ /archive/$1

ErrorDocument 404 /archive/404/
ErrorDocument 403 /archive/403/

AddDefaultCharset utf-8Does anyone know how I can just mask the URI instead of redirecting (so that the URI remains http://jero.net/ instead of http://www.jero.net/archive/). Thanks in advance!

04-15-2005, 11:30 PM
I think it's the "L" at the end of the rule - if you remove that then it won't update the location

04-15-2005, 11:34 PM
The first RewriteRule is to get rid of the www subdomain. I already tried my .htaccess without that, but it the URI http://jero.net/ was still changed to http://www.jero.net/archives/

05-13-2005, 09:48 PM
Nevermind this topic. I got it fixed. It was all caused by WordPress' .htaccess...