WordPress.org

Ready to get started?Download WordPress

Forums

WordPress blog as sub-directory on IIS-hosted website (1 post)

  1. cirrus2001
    Member
    Posted 5 months ago #

    I'm trying to make my wordpress blog (hosted on 192.168.0.79) to be accessible from other Windows/IIS/ASP.NET-application (currently http://localhost/). My goal is to access blog using url: http://localhost/blog/

    I've installed AAR and URL Rewrite and my web.config file is looking like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <system.webServer>
        <rewrite>
            <rules>
        <rule name="Route the requests for Blog" stopProcessing="true">
                    <match url="^blog/(.*)" />
                    <conditions>
                        <add input="{CACHE_URL}" pattern="^(https?)://" />
                    </conditions>
                    <action type="Rewrite" url="{C:1}://192.168.0.79/{R:1}" />
                    <serverVariables>
                        <set name="HTTP_ACCEPT_ENCODING" value="" />
                    </serverVariables>
                </rule>
            </rules>
     <outboundRules>
                <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1" stopProcessing="true">
                    <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^http(s)?://192.168.0.79/(.*)" />
                    <action type="Rewrite" value="/blog/{R:2}" />
            <conditions>
                <add input="{HTTP_HOST}" pattern="^192.168.0.79$" />
                    </conditions>
                </rule>
        <rule name="RewriteRelativePaths" preCondition="ResponseIsHtml1">
                    <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^/(.*)" negate="false" />
                    <action type="Rewrite" value="/blog/{R:1}" />
                </rule>
                <preConditions>
                    <preCondition name="ResponseIsHtml1">
                        <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                    </preCondition>
                </preConditions>
            </outboundRules>
        </rewrite>
    </system.webServer>

    I can access blog using http://localhost/blog/ and all links work fine, but when I try to access WordPress admin http://localhost/blog/wp-admin I get 404.0 error (url: http://localhost/wp-login.php?redirect_to=http%3A%2F%2F192.168.0.79%2Fwp-admin%2F&reauth=1)

    I feel like this could be an authentication problem when AAR Reverse Proxy approach, but I'm not sure.

Reply

You must log in to post.

About this Topic