Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I am trying to setup a Wordpress blog to run in the subdirectory of an ASP.NET wbforms application so I can have http://www.myapplication.com/blog

I have Wordpress running on IIS 7 fine as it's own application but when I create the 'blog' subdirectory and set it to be an application with the Wordpress folder as the application root. I keep coming up against a configuration error...

HTTP Error 500.19 - Internal Server Error
Config Error    Configuration section not allowed to be set below application

I've done quite a bit of searching on this and I have tried modifying the applicationHost.config file to set the following value...

<section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Deny" />

But the configuration errors persist. Can anyone suggest any other config changes I need to make to allow the Wordpress application to run in the /blog subdirectory?

share|improve this question
add comment

migrated from stackoverflow.com Jul 2 '11 at 7:45

This question came from our site for professional and enthusiast programmers.

2 Answers

What is in the web.config that is in your /blog directory? For WordPress to work correctly you just need a very minimal URL rewrite rule which is allowed to be set on sub-directories:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <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>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

If you really need to set configuration settings that can only be set at the application root (can't think of any) you can always turn the /blog directory into it's own application. This can be done from the IIS Manager. Expand the website and drill down to the 'blog' directory. Right-click on the directory and click 'Convert to application'. The defaults in the dialog that shows up should be OK but you can optionally choose to run WordPress in a different app pool.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.