I have a WordPress site hosted on a Go Daddy server running Apache. My experience is on Windows IIS, so this might be an easy question, but I can't figure it out. I want to allow URLs at my site like:


The problem is two fold.

1) If I enter


the URL is fine, but if I enter:


the URL is rewritten to:


Note the lost single quote is shown in the browser address.

2) The page requires memebr acce3ss. When you browse to it without logging in you are sent to the login page with the URL


Note the added backslash and then after login the page goes to:


Is it WordPress or the server that is messing with the single quotes? Am I crazy to want to allow single quotes in my URLs? If so, why doesn't PHP or javaScript encode them?

1 Answer 1


Wordpress will strip off special characters, since they can cause issues when writing to the database. It's best practice to avoid using special (reserved) characters in URLs, as they can and will break when passing them around. Case in point, see your own post and the cutting off of the URL after the '.

  • so you think I should escape them?
    – mrjrdnthms
    Commented Feb 29, 2012 at 3:57
  • 1
    If you absolutely must have the apostrophes in them, then yes you should escape them. However, you are almost guaranteed to run into problems down the road if using any of these characters: < > " ' & - most notably in your sitemap, as they're not valid XML and will cause spiders to report the page as a 404. I can't stress enough to avoid using them if at all possible.
    – SickHippie
    Commented Feb 29, 2012 at 7:02
  • Would it be ok to have urls like: my.site.com/biz/Jordan%27s_place/jordan ?
    – mrjrdnthms
    Commented Feb 29, 2012 at 21:33
  • 2
    That should be just fine, since the percent encoding would be translated properly by both browser and server - this way even if it's passed around as a link, it will still be valid no matter what.
    – SickHippie
    Commented Feb 29, 2012 at 22:42
  • 1
    Thanks for pointing me in the right direction. This worked for me.
    – mrjrdnthms
    Commented Mar 1, 2012 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.