Michael Gray

Htaccess %3F Rewrite

Posted on May 23rd, 2006
by 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

Text Link Ads


8 Responses to “Htaccess %3F Rewrite”

  1. User Gravatarandy Says:

    how about using PHP/urldecode:

    http://us3.php.net/urldecode

  2. User GravatarCal Says:

    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?

  3. User Gravataranty Says:

    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.

  4. User Gravatarquadszilla Says:

    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.

  5. User GravatarAdministrator Says:

    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.

  6. User GravatarFlanker Says:

    I see you’ve fixed the problem… care to share your secret with us who are still searching for answers?!

  7. User GravatarAdministrator Says:

    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.

  8. User GravatarFlanker Says:

    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?!