I would like the last parameter/directory from the following urls:
http://example.com/movies/randomMovie
http://example.com/books/randomBook
to be passed like following:
http://example.com/movies.php?=randomMovie
http://example.com/books.php?=randomBook
I have tried the following:
RewriteEngine on
RewriteRule ^([^/d]+)/?$ movies.php?=$1 [QSA]
RewriteRule ^([^/d]+)/?$ books.php?=$1 [QSA]
But that overwrites the rule for (movies.php).
How do I achieve this in .htaccess?