Hi guys,
I'm trying to create an conditional Rewrite Rule using an .htaccess file and Apache.
Basically what I need is that the Apache would check if the requested file exists in a sub folder, case in which Apache would serve this existing file, or, if the file does not exist, Apache would load the index.php file.
The folder structure I'm using is:
- /gallery
- /cache
- index.php
- .htaccess
also, the .htaccess I have now is
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.+) - [PT,L]
RewriteRule ^(.*)$ index.php/$1 [L]
however, this works only if the file I'm trying to look for is in the /gallery folder, however I need to look if the file exists in the /cache folder instead.
Does anyone know how to modify this rules in order to achieve that?
Thank you in advance,
titel