Hi, I'm trying to redirect a bunch old urls to a newer and better url using RedirectPermanent, but for one subset its just not working!... Rules such as RedirectPermanent /contact.php http://lonewolf-online.net/contact/ Code (markup): work exactly fine, however if they have a '?' in them it just refuses to work. I also tried RedirectMatch but still get a 404. RedirectPermanent /doarticle.php?article=computer_howto_hpze5400 http://lonewolf-online.net/computers/tutorial/hp_pavilion_ze5400_dismantle/ Code (markup): and RedirectMatch ^/doarticle.php/\?article=computer_howto_hpze5400$ http://lonewolf-online.net/computers/tutorial/hp_pavilion_ze5400_dismantle/ Code (markup): and some of the existing inbound links contain a forward slash before the ?: RedirectPermanent /doarticle.php/?article=computer_howto_hpze5400 http://lonewolf-online.net/computers/tutorial/hp_pavilion_ze5400_dismantle/ Code (markup): How do I get these to redirect?? I have about 2 dozen different article= urls. Its been driving me crazy. Thanks
Thanks, I tried using RewriteCond %{REQUEST_URI} doarticle.php/\?article=computer_howto_hpze5400 [NC,OR] RewriteRule ^(.*) http://lonewolf-online.net/computers/tutorial/hp_pavilion_ze5400_dismantle/ [R=301,L] Code (markup): which redirects to http://lonewolf-online.net/computers/tutorial/hp_pavilion_ze5400_dismantle/?article=computer_howto_hpze5400 Code (markup): but how do I remove the ?article=computer_howto_hpze5400 from the URL? I am now getting a Thanks
Hi, I'm still having problems with this. I have been playing around with various combinations of the above as well as this: RewriteCond %{QUERY_STRING} ^article=computer_howto_hpze5400 RewriteRule /* http://lonewolf-online.net/computers/tutorial/hp_pavilion_ze5400_dismantle/ [R,L] Code (markup): But either the rule does not pick up or it gets stuck in a infinite loop. The value of article in the query string will never be the same as the new url. doarticle.php has not existed on the site for a few years and never will. There must be a way of redirecting a url containing a query string... Anybody able to help? Thanks lonewolf
The url has not changed. I removed doarticle.php in favour of a new cleaner structure. I don't need anything fancy or dynamic, just a google friendly redirect of http://lonewolf-online.net/doarticle.php?article=computer_howto_hpze5400 to http://lonewolf-online.net/computers/tutorial/hp_pavilion_ze5400_dismantle/ I have many more pages and articles that will be redirected in the same way. I was hoping just a simple RedirectPermanent (as first post) would suffice. Thanks anyway, lonewolf