2

I have to configure WordPress into a virtual application under a principal website running on ASP.NET 2.0 Classic mode.

Everything is working fine, PHP 5.3.13 / MySQL 5.1 / IIS 7.5, the wordpress site also work fine, except for the rewriting side.

The blog is host at www.mysite.com/blog , and rewriting should normally rewrite article to www.mysite.com/blog/categorie/this-is-a-pretty-article but instead it rewrite to www.mysite.com/blogcategorie/this-is-a-pretty-article, as you see, it strip the tag between blog and categorie, wich is not suitable.

The rewriting rules inside web.config are pretty straight forward, taken from auto-generated Wordpress Permalink section :

    <rewrite>
    <rules>
            <clear />
            <rule name="wordpress" patternSyntax="Wildcard" stopProcessing="false">
                <match url="*" />
                <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                </conditions>
                <action type="Rewrite" url="index.php" appendQueryString="true" />
            </rule>
    </rules>
</rewrite>

I've been losing allmost by whole day on this, so I tough asking for it might be a good idea...

Anybody already had that kind of trouble with wordpress on IIS?

Thanks in advance

7
  • What do you have in the Wordpress config for Custom Structure under permalinks (since I guess that's where you're setting this). May 17, 2012 at 21:47
  • Does the problem occur on all pages, or just category pages? May 18, 2012 at 14:00
  • All pages are affected by this bug. May 18, 2012 at 14:19
  • Does my updated code below resolve it? May 18, 2012 at 14:37
  • 1
    I'm out of ideas then (and have deleted my answer since it's not right) - there's a Wordpress Stack Exchange site, have you searched on there? wordpress.stackexchange.com May 18, 2012 at 19:26

1 Answer 1

1

I think your problem is a pure WordPress settings issue. The rewrite rules from your post are only important for incoming requests. I.e. they rewrite the URL from an incoming request to the index.php page. They are of no importance for any URL's generated by WordPress and that's clearly where your problem is.

My guess is that you have not properly configured Settings -> General -> WordPress address (URL) and Settings -> General -> Site address (URL). Both should be set to http://www.mysite.com/blog (without a trailing slash). If you use custom permalinks (Settings -> Permalinks) your should leave out /blog in front of it. WordPress will add that automatically as is also shown on that page.

When configured like this, it should work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .