Click to See Complete Forum and Search --> : .htaccess separate root directory for files


SlappyTheFish
11-16-2007, 05:50 AM
Hello.

In my root folder I have an index.php file which processes all the page request for my web application. The requests come in the form of /welcomepage/ and are rewritten to index.php?page=welcomepage in .htaccess.

However, if a request for a files comes in, for example "/css/default.css", I'd like it to look in a separate folder for these public files, e.g. /public/ so the request above, it would return the file /public/css/default.css

I have this at the beginning of my .htaccess file:

RewriteCond public/%{REQUEST_URI} -f
RewriteRule ^(.+)$ public/$1 [QSA,L]

The idea is that if the file exists in the public folder, then it is returned.

Does anyone have any idea why this isn't working?

Thanks.