Forum Moderators: phranque

Message Too Old, No Replies

Repairing old urls

         

alicethetic

12:58 pm on Dec 4, 2010 (gmt 0)

10+ Year Member



So I am trying to fix old urls with htaccess but I am kinda encounting an annoying problem. I've spent close to about four hours now querying google on how to fix this issue and have turned up empty handed.. So here is what I have

I had urls such as
http://domain.com/blog/page/action/subaction/


which is basically.
http://domain.com/blog/page.php?acti...tion=subaction


I have moved all the files from the blog directly to my root directory and now I am trying to redirect the old urls so that example

http://domain.com/blog/page/


redirects to

http://domain.com/page/


thing is though I am getting a query string appended to the url when I use a 301 redirect like so

http://domain.com/page/?action=page


It's rather ugly and annoying and I don't think I have all the hair in the world to pull out.. This is my current htaccess for the urls

RewriteRule ^([^/]*)/$ /$1.php [L]
RewriteRule ^([^/]*)/([^/]*)/$ /$1.php?action=$2 [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/$ /$1.php?action=$2&subaction=$3 [L]


What can I do to remove the query string from being appended to the urls?

g1smd

1:58 pm on Dec 4, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You have shown the code for three rewrites.

Where is the code for the redirects that are having a query string appended?