What are the mod_Rewrite rules for checking the location of multiple folders for a given file. For example, if I have a folder structure:
public/
css/
library1/
css/
library2/
css/
and I want the queries to /css/somefile.cssfirst check the directory public/css/, then cascade to public/library1/css/, then public/library2/css/return 404 if the object cannot be found in any of the directories.
I thought line by line:
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond library1%{REQUEST_URI} -f
RewriteRule ^(.*)$ library1$1 [L]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond library2%{REQUEST_URI} -f
RewriteRule ^(.*)$ library2$1 [L]
But this does not work - I'm not sure how to check for the existence of a file on a dynamically generated path.
source
share