Htaccess %3F Rewrite
Posted on May 23rd, 2006by Michael Gray in Programming, SEO
If you're new here, you may want to subscribe to my RSS feed. Read my top posts or learn more about Michael Gray. Want more frequent updates follow me on Twitter. Thanks for visiting!
All right I’ve looked around can’t seem to find the answer, so hopefully one of my nice readers knows the answer and will share. I’m getting a bunch of inbound links that look like this
http://www.wolf-howl.com/%3Fp=324
http://www.wolf-howl.com/%3Fp=325
http://www.wolf-howl.com/%3Fp=326
%3F is the URLencoded character for a [?]. I could do something manual but I’m looking for a slicker more programatic way to rewrite the %3f character to a ? and keep the remaining query string intact.
Sphere: Related Content










May 23rd, 2006 at 11:29 pm
how about using PHP/urldecode:
http://us3.php.net/urldecode
May 24th, 2006 at 5:02 am
no idea what you are getting at. Not into the SEO stuff. But string replacement is easy in php and the like that what you want?
May 24th, 2006 at 6:35 am
It should be something like:
RewriteRule ^(.*?)%3F(.*)$ %1?%2 [L]
I’ve not testet it, but I think it should work like that or slightly modified.
May 24th, 2006 at 6:47 am
Why not just implement SEFURLs and redirect your existing posts to the new URLs. Then you get the benifit of nice URLs and you won´t have this problem in the future because you won’t have a ? in the URL.
That’s what I would do.
May 24th, 2006 at 7:40 am
Anty I think you’re close too, but it didn’t work I’ll play with it.
Quadszila I’m thinking about it but I’ve got 400ish url’s to redirect, something I’m not thrilled about, but may end up up doing.
May 25th, 2006 at 1:00 am
I see you’ve fixed the problem… care to share your secret with us who are still searching for answers?!
May 25th, 2006 at 6:38 am
nope not yet but I’m doing what quadszilla says. I know it’s the right thing to do and it’s what I would have a client do. Ripping off the band-aid is going to hurt though.
May 26th, 2006 at 12:15 am
Good for you!
My problem is that I’ve made search engine friendly URL’s for a client’s site, yet Yahoo keeps hitting the old urls - with %3F as the query string prefix… wtf?!