Allow single quote in URLs

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:

http://my.site.com/biz/Jordan‘s_place/jordan/

Read More

The problem is two fold.

1) If I enter

http://my.site.com/biz/Jordan‘s_place/jordan/

the URL is fine, but if I enter:

http://my.site.com/biz/Jordan‘s_place/jordan

the URL is rewritten to:

http://my.site.com/biz/Jordans_place/jordan/

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

/wp-login.php?redirect_to=/biz/Jordan’s_place/jordan/

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

http://my.site.com/biz/Jordans_place/jordan/

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?

Related posts

Leave a Reply

1 comment

  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 ‘.