I am using cakephp and now I need to do a inner redirect to an .html if the file exists inside a cache folder.
So, lets say there is a controller CTRL and action ACT, the url for it is:
domain.com/ctrl/act
Now, I want my htaccess to check if there is an .html inside teh cache folder with the same name of the controller and the action, like:
/cache/ctrl/act.html
if the file exists, just send it and don't touch the php.
I got it to work but now the cakephp is not being processed, the server returns a 500 error.
Can you please help me with this. I also need to check if there is an /index.html within the cachefolder/ctrl/ because the links sometimes has only the controller name.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI}.html !^/cache
RewriteRule ^(.*)$ cache/$1.html [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>