How to use Unicode in WordPress slugs (Urls) on Windows 2008 / 2012 (IIS 7 & 8)


My wife has a bilingual weblog. She writes in Arabic and in English. One thing she noticed is that when she writes a post in Arabic, and does not specify a post slug (URL) manually, WordPress will generate a slug in Arabic based on post title (which is encoded to equivalent URL Unicode escape characters).

The problem is that URL was quite unusable, going to the the URL (say, by clicking the post title in homepage) would redirect to blog homepage instead of the post details page, making the inaccessible except in homepage and category index page. She had to go back and change the post slug to something in English to make it accessible / linkable.

Putting aside whether it’s a good idea or not to have your URL path / post slug in Arabic or Unicode in general, I knew I have seen it before, and it really should work without much effort.

The Solution

Luckily, someone had a StackOverflow answer that did help me. the problem seems to have something to do with the implementation of the FastCGI module in IIS 7.x, and IIS 8 / Windows Server 2012.

The relevant link was a Microsoft Knowledge Base article that suggested: * A Service Pack install, which did not help much, because I already keep my hosting VPS always up to date with regular Windows Updates * A Registry fix, which did the trick nicely

The Registry Fix

The KB article suggested this as an example, I just copied the following code, went to Start -> Run and pasted it in:

reg add HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\w3svc\Parameters /v FastCGIUtf8ServerVariables /t REG_MULTI_SZ /d REQUEST_URI\0PATH_INFO

It didn’t work instantly though, I also needed to run IISReset to get Arabic URLs to work.

And that was it!

Share With Friends:

How did I learn that?

As a bonus for coming here, I'm giving away a free newsletter for web developers that you can sign up for from here.

It's not an anything-and-everything link list. It's thoughtfully collected picks of articles and tools, that focus on Angular 2+, ASP.NET (4.x/MVC5 and Core), and other fullstack developer goodies.

Take it for a test ride, and you may unsubscribe any time.

You might also want to support me by checking these out [Thanks]: