I have the code below in my .htaccess file to remove php from the filename in the URL
# Apache Rewrite Rules
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
I now need to change the URL
editpermit.php?type=edit&id=1
to
editpermit/edit/1
I've added below but I get the error 'Request exceeded the limit of 10 internal redirects due to probable configuration error.'. Other posts say to add an L to the end to show it's the last line but it's not making any difference.
RewriteRule ^editpermit/([a-z]*)/([0-9]+)$ editpermit.php?type=$1&id=$2 [NC,L]
I plan to have a few pages that will use this configuration so I need to know how to add these too at a later time
My full htaccess file is below
# Error pages
ErrorDocument 403 /403.php
ErrorDocument 404 /404.php
ErrorDocument 405 /405.php
ErrorDocument 500 /500.php
ErrorDocument 503 /503.php
# Apache Rewrite Rules
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
RewriteRule ^editpermit/([a-z]*)/([0-9]+)$ editpermit.php?type=$1&id=$2 [NC,L]