RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ cat.php?id=$1 When i did that http://domain/cars http://domain/autos works fine. If i add this rule below that one RewriteRule ^details/(.*)$ details.php?name=$1 http://domain/details/ferrari does not open details.php. It opens cat.php and gives id=details/ferrari It is taking the first wildcard and ignoring the second. Moving the second rule upper did not change anything. What am i missing?
I think you need to add a backslash for the '/'. Try with: RewriteRule ^details\/(.*)$ details.php?name=$1
Options +FollowSymLinks +Indexes RewriteEngine on RewriteBase / RewriteRule ^details/([^.]+)$ details.php?name=$1 RewriteRule ^([^.]+)$ cat.php?id=$1 or try switching them if it doesn't work.