How to Encode an Apostrophe in a URL
It is not possible to use an apostrophe within a URL you assign to a page or post on your website, even if an apostrophe appears in the page's or post's title. Encode the apostrophe within the URL to ensure readers can access the page.
If you attempt to place an apostrophe within your URL, clicking its link takes readers to a "Page Not Found" error.
- It is not possible to use an apostrophe within a URL you assign to a page or post on your website, even if an apostrophe appears in the page's or post's title.
Type out the title of the page into a desired URL, leaving the apostrophe intact. For example, if the page title you wish to use is "Chocolate's Many Flavors," do this as follows:
Replace the apostrophe with the HEX code for the character, which is %27. For the example URL:
Save the file. Open your home page in a new tab or window, then click the link to the file whose URL contains and apostrophe. Notice that it opens without incident.
Robert Schrader is a writer, photographer, world traveler and creator of the award-winning blog Leave Your Daily Hell. When he's not out globetrotting, you can find him in beautiful Austin, TX, where he lives with his partner.