Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WordPress Arabic permalinks on IIS

I have an Arabic WordPress site hosted on a Windows Server with IIS7 (I can't move to Linux hosting). I tried to change the permalinks settings in WordPress to this: /%postname%/

But when I access any article for example like this: http://www.example.com/تجربة/ I'm being redirected to the homepage, same thing happens with categories and tags.

I don't have access to IIS settings except for the web.config (I'm on shared hosting). Here's my web.config settings:

        <rule name="wordpress" patternSyntax="Wildcard">
            <match url="*" />
                <conditions>
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                </conditions>
            <action type="Rewrite" url="index.php" />
        </rule>

I'm running on PHP 5.5.

like image 501
Ahmad Hania Avatar asked Mar 14 '23 02:03

Ahmad Hania


1 Answers

This issues is caused due to IIS does not recognize the multi language urls,

You need to add the following code at the end of the wp-config.php file:

if ( isset($_SERVER['UNENCODED_URL']) ) {
$_SERVER['REQUEST_URI'] = $_SERVER['UNENCODED_URL'];}
like image 54
SOAL ABDELDJALLIL Avatar answered Mar 30 '23 06:03

SOAL ABDELDJALLIL