Rewrite URL – how to do a SEO-friendly Unicode custom URL?

SEO vs. Unicode
After a major load of 404 with some category and tag URL, I questioned on StackOverflow about my WordPress blog. My blog is in Unicode Bānglā. After a nice anatomy on the fact in Facebook1 with some CodeGeeks, we came to a solution for both 404 on Unicode characters and SEO for Unicode sites.

THE IDEA
Mr. Sarim Khan (the Gittu) suggested a nice solution for a URL:

Read More
  • For category: http://www.example.com/category/astronomy/জ্যোতির্বিজ্ঞান‌‌‌‌‌‌‌‌‌
  • For posts: http://www.example.com/%postid%/আমার-পোস্টটি-যে-বিষয়ে

For this case the article will browse with the preceding category /astronomy, and will work for English SEO too. And the rest of the section /bānglā-slug would work for Bānglā SEO, and with this method the 404 can be minimized to a great extent.

But for a nice URL with Bānglā contents, I can manage my post and page URL, when I’m writing my page or post. But for Bānglā tags, and categories, how can I achieve such a modified URL? How can I put a Bānglā and English tag/category (taxonomy) at a time?

REAL QUESTION
Currently I’m following http://domain/%postname%. How can I rewrite my URL, so that I can achieve such a benefit of lesser 404 for Unicode URL, and also doesn’t get down in SEO chase.

Desired URL is:
http://domain/%english-slug%/%bangla-slug%

And of course: Is that really possible?

1. Facebook thread image: I’m afraid, most of the discussion was in Bānglā.

Related posts

1 comment

  1. If you write your post titles in Bānglā but set the post slug in English, you can do this:

     function wpse117090_pre_post_link( $permalink, $post ) {
        return str_replace( '%posttitle%', sanitize_title( $post->post_title ), $permalink );
     }
    
     add_filter( 'pre_post_link', 'wpse117090_pre_post_link', 10, 2 );
    

    Then change your permalink structure to, for example, /%postname%/%posttitle%/

    (Please note that the above code doesn’t make %posttitle% an actual queryable rewrite tag, it’s just a simple string that gets replaced by the sanitized post title when the permalinks are created.)

Comments are closed.