I am trying to redirect to a subdirectory for files, but only if the file exists in the subdirectory. Essentially, its modeled like this:
- Does the file exist regularly? If so, display it.
- Does the file exist in the subdirectory? If so, redirect to it.
- If we're at this point, route into a dynamic script at index.php.
The tough part has been step 2. Here's what I've tried to far:
RewriteEngine On
RewriteCond engine/%{SCRIPT_FILENAME} -f [OR]
RewriteCond engine/%{REQUEST_FILENAME} -d
RewriteBase /lab
RewriteRule ^(.*)$ /lab/engine/$1 [P]