Forum Moderators: phranque
I have just gotten familiar with mod_rewrite and wrote a nice rule as follows:
RewriteEngine on
RewriteRule ^page/(.*)?$ index.php?page=$1 [L]
The above rule will allow pages going from www.mysite.com/page/the_page to www.mysite.com/index.php?page=the_page
However, since I had been using .asp pages in the form of module.asp?page=the_page they have been archived by search engines. I want to redirect any of those page requests to the same www.mysite.com/page/the_page format.
I tried using the below code:
RewriteRule ^module.asp\?page=(.*)$ /page/$1 [R=301]
But it doesn't seem to work. So my question is, what is wrong with my rule, am I missing something? Hope someone here can help me.
Thanks in advance.