Let's suppose I have the following rewrite rules in my .htaccess file:
- Code: Select all
RewriteEngine on
RewriteRule ^firstpage$ firstpage.php [L]
RewriteRule ^secondpage$ secondpage.htm [L]
RewriteRule ^(.*)$ otherpage.php
Basically, I want it to redirect "firstpage" to "firstpage.php", "secondpage" to "secondpage.htm" and everything else to "otherpage.php".
But, for example, if I access "firstpage", it internally redirects to "firstpage.php" and then internally redirects again to "otherpage.php", because "firstpage.php" matches "(.*)".
I hope I have made myself understood. Is there any way to fix this?
Thanks!