Hi all apache experts,
I have a problem adding a default rewrite php and html requests to my apache .htaccess.
The idea is to set up templates for the content on my site, specifying that the content in a folder uses a specific template. It works fine for html, image and other resources; requests are rewritten to the template nicely. But I get a recursive problem rewriting request to php-resources, because the template is also a php-resource… perhaps logically enough.
Is it possible to limit the php-to-php to a single rewrite? Or do I need another approach ?
This rule is my problem:
RewriteRule ^(.*).(php$) /_templates/default.php?$1.$2 [NC,L]
Below is my .htaccess...
Thanks...
# Template rewrites:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(subpages/.*) /_templates/present.php?$1 [NC,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*).html$ /_templates/default.php?$1 [NC,L]
RewriteRule ^(.*).(php$) /_templates/default.php?$1.$2 [NC,L]