RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !\.php$
RewriteRule ^(.*)/(.*)/(.*)$ $1.php?Action=$2&id=$3
RewriteRule ^(.*)/(.*)$ $1.php?Action=$2
RewriteRule ^(.*)$ $1.php
Here is my .htaccess. However only the first RewriteRule works. If I comment out other rules, the others left work fine, but they don't work together. What I want is the clean URL with multiple parameters.
I don't have any clue of this problem. I Googled a lot and all the information I've found says the same as my code.
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !.php$
RewriteRule ^(.)/(.)/(.)$ /api/$1.php?Action=$2&id=$3 [L] RewriteRule ^(.)/(.*)$ /api/$1.php?Action=$2 [L]
– user1942626 Aug 10 '13 at 12:41