Meh Man
Meh Man

Reputation: 473

wordpress url rewriting in asp.net website not work for categories and tags

I am using wordpress engine in my asp.net website for blogging.
I am using url rewriting like /posts/%post_id%/ in settings. every things work right except categories and tags.
I set base category to 'category' and base tag to 'tag'. Categories urls appear like '/blog/category/(something)/' but it raise 404 error.
Wordpress web.config is like this:

<rewrite>
<rules>
    <rule name="Main Rule" stopProcessing="true">
        <match url=".*" />
        <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
        </conditions>
        <action type="Rewrite" url="index.php" />
    </rule>
</rules>

Upvotes: 0

Views: 121

Answers (1)

Meh Man
Meh Man

Reputation: 473

This is the solution:
In the wp-config.php file add this code:

if (isset($_SERVER['UNENCODED_URL']))
     $_SERVER['REQUEST_URI'] = $_SERVER['UNENCODED_URL'];

Upvotes: 1

Related Questions