Htaccess %3F Rewrite

Michael Gray

By Michael Gray
In Programming, SEO  

Print Post Print Post Email Post Email Post    ADD TO STUMBLEUPON Sphinn It ADD TO DEL.ICIO.US  Tweet This

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.

No related posts.

Crazyegg Link Tracking

{ 8 comments }

andy May 23, 2006 at 11:29 pm

how about using PHP/urldecode:

http://us3.php.net/urldecode

Cal May 24, 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?

anty May 24, 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.

quadszilla May 24, 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.

Administrator May 24, 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.

Flanker May 25, 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?!

Administrator May 25, 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.

Flanker May 26, 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?!

Comments on this entry are closed.