Pretty URLs and mod_rewrite page redirect problem
Posted: Tue Oct 18, 2011 3:47 pm
We have pretty urls enabled with mod_rewrite, which is working fine, but I am running into a small problem. We are using .html for our current page extensions, but had some previous pages with .php that we want to redirect any incoming links to the new pages with .html extensions.
example -
previous site - books.php
new site - books.html
These automatically redirect to books.html?page=books.php, which of course throws a URL not found error.
I'm assuming this is because of the rewrite rules in place.
How can I get these to redirect correctly?
Any help would be greatly appreciated!
Thanks
LadyHLG
example -
previous site - books.php
new site - books.html
These automatically redirect to books.html?page=books.php, which of course throws a URL not found error.
I'm assuming this is because of the rewrite rules in place.
Code: Select all
# For Friendly URLs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?page=$1 [L,QSA]
Any help would be greatly appreciated!
Thanks
LadyHLG