Apache rewrite to add a directory to REQUEST_URI not working on localhost running wamp.

Posted by Brett Pontarelli on Stack Overflow See other posts from Stack Overflow or by Brett Pontarelli
Published on 2010-03-24T05:07:35Z Indexed on 2010/03/24 5:13 UTC
Read the original article Hit count: 339

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about apache

Related posts about mod-rewrite