Apache rewrite to add a directory to REQUEST_URI not working on localhost running wamp.
- by Brett Pontarelli
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.