I am looking for some best practice / practical advise on a particular URL use case. I am finding myself using a lot of non-ASCII characters in my URLs. This doesn't really make it easy for users of ASCII computer keyboard layouts to input the URLs or copy the URLs from the browser bar (if they do then it looks like HTML %CC%B1 crap).

Example: when the following URL is copied from the browser URL bar http://www.hughandbecky.org/2005/u̱t-Maꞌin

When it is pasted it looks like this:


mostly because the underline of the u is really unicode character combining macron below U+0331 and the ' looking character is really a lowercase Saltillo unicode latin small letter saltillo U+A78C

What I want to be able to do is allow is allow Americans using ASCII keyboards to type in things like http://www.hughandbecky.org/2005/ut-main or http://www.hughandbecky.org/2005/ut-ma'in (with ' being a single quote this time) and be redirected to http://www.hughandbecky.org/2005/u̱t-Maꞌin.

I know that I could use the plugin redirection and have used it in the past. But this has several drawbacks. Namely, the list could get rather long over time, and it is not managed on the post. So, I would like to manage this in the post's admin screen... Like managing a custom field. This way if I delete the post then it also deletes the additional URLs. I have seen this question http://wordpress.org/support/topic/multiple-slugs-per-post-in-35 about multiple slugs for WordPress, and in a sense I guess I could conceptualize it that way... but there is no plugin for that either. So, my question is really, what can be done about this kind of thing?

1 Answer 1

  1. Add a new field below the post title and use something like my transliteration table to convert the post slug to US-ASCII. Then save that new slug in a meta field.

  2. Hook into 404_template (example), and run a meta query for the current slug.

  3. If you found something, use get_permalink() for the result and wp_redirect() to send the user to the correct location.

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.