• Hello everyone! Thanks for taking time to read my post.
    I am having a hell of a time getting my subdomain to behave with WP.

    Here is the setup:
    IIS hosted Win Server 2008r2
    Main website is sitting behind a https cert
    the WP site is is sitting in a subdirectory ../blog/
    I’m trying to achieve blog.mysite.com

    I’ve been hardcoding the WP_HOME and WP_SITEURL in the wp-config file for testing. (That way if an address entry blows my connection, I can easily bring it back)
    Current settings: WP_HOME = http://mysite/blog. WP_SITEURL = http://blog.mysite.com

    My corporate web host setup the subdomain and if you navigate to it directly, everything works great! If you navigate to the WP page/post directly everything works great.

    BUT if you click a link, the link is http://mysite.com/blog/?p=123. This URL will NOT resolve to the blog.mysite.com/?p=123. Instead it gets pushed to https://www.mysite.com/blog/?p=123

    None of my attempts to include a URL Rewrite in my web.config file have been successful. Is this because of the HTTPS setting grabbing my URL, or is there something I’m missing?

    Here is my current URL rewrite rule:

    
    <rule name="subdomain">
                        <match url="/blog/(.*)" />
                        <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                            <add input="{HTTP_HOST}" pattern="^blog\.stdins\.com$" />
                            <add input="{REQUEST_URI}" pattern="!^/blog/" />
                        </conditions>
                        <action type="Rewrite" url="(.*)/blog/$1" />
                    </rule>
    
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Rewrites for Subdomain’ is closed to new replies.