I'm running wamp
on Vista (Apache v2.2.11) and have projects setup such that http://localhost/projectx
is the base directory for projectx
. Now, I want that requests for
http://localhost/projectx/somepage/extra
will rewrite to
http://localhost/projectx/PUBLIC/somepage/extra
To that end I have a file in C:\wamp\www\projectx\.htacces
that is this simple:
RewriteEngine On
RewriteBase /projectx
RewriteCond %{REQUEST_URI} !^/PUBLIC
RewriteRule ^(.*)$ /PUBLIC$1 [L]
I can't for the life of me figure out why this doesn't work. The error I'm getting is "The requested URL /PUBLIC was not found on this server". Thanks.
UPDATE 25-MAR-2010:
As per Michael's solution I removed the absolute path. For some reason I also needed to add a final slash to the Cond and Rule:
RewriteEngine On
RewriteBase /projectx
RewriteCond %{REQUEST_URI} !^/PUBLIC/
RewriteRule ^(.*)$ PUBLIC/$1 [L]