Using altered RewriteCond to check if file exists in multiple locations

Posted by futuraprime on Stack Overflow See other posts from Stack Overflow or by futuraprime
Published on 2010-05-29T13:04:24Z Indexed on 2010/05/29 13:12 UTC
Read the original article Hit count: 236

I want to use mod-rewrite to check for a file in two separate locations: at the requested URL, and at the requested URL within the "public" directory.

Here's what I have so far:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/public/$0 !-f  #this line isn't working
RewriteRule ^(.*)$ index.php?$1 [L]

It can correctly determine if the file is there, but it's not correctly determining if the file is at /public/supplied/file/path/file.extension. How do I test for that?

© Stack Overflow or respective owner

Related posts about .htaccess

Related posts about mod-rewrite