Doh. It matches the sub request to the .php file and loops.
You could check that the controller.php file exists
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/(css|images|javascript)(/.*)?$ [NC]
# Check /controller.php exists.
RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule ^([^/]+)(/([^/]+)(/([^/]+))?)?/?$ /$1.php?action=$3&id=$5 [NC,QSA,L]
Or ignore all existing files and directories
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/(css|images|javascript)(/.*)?$ [NC]
# Ignore all requests to existing files.
RewriteCond %{SCRIPT_FILENAME} !-f
# Ignore all requests to existing directories.
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^/]+)(/([^/]+)(/([^/]+))?)?/?$ /$1.php?action=$3&id=$5 [NC,QSA,L]
Or ignore all sub requests
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
# Ignore all sub requests.
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{REQUEST_URI} !^/(css|images|javascript)(/.*)?$ [NC]
RewriteRule ^([^/]+)(/([^/]+)(/([^/]+))?)?/?$ /$1.php?action=$3&id=$5 [NC,QSA,L]