Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

IIS, Wordpress and sub-domains

$
0
0

I recently moved to a new web host and they handle sub-domains differently than my previous.

I must use the URL Rewrite module to handle this.

So I have mydomain.com and test.mydomain.com that I need to get functioning.

The folder structure is:

webroot/

webroot/test/

Both are Wordpress installations and essentially what I need it to set this up so mydomain.com and test.mydomain.com act as if they are their own websites. So that requests formydomain.com/postname/ is handled by the index.php in webroot/ and test.mydomain.com/postname/ is handled by mydomain.com/webroot/test/index.php

Also for references like test.mydomain.com/wp-content/themes/mytheme/style.css refer to the file located at webroot/test/wp-content/themes/mytheme/style.css

My research and limited understand of URL Rewrite has gotten me to the point where I can get test.mydomain.com to show the main page of that site and the main domain is working properly.

So far here's what I have:

In the web.config located at webroot:

 <rules>
                <clear />
                <rule name="test.mydomain.com" stopProcessing="true">
                    <match url="^(.*)$" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{HTTP_HOST}" pattern="^test\.mydomain\.com$" />
                    </conditions>
                    <action type="Rewrite" url="\test\{R:1}" />
                </rule>
                <rule name="wordpress" patternSyntax="Wildcard">
                    <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" />
                </rule>
            </rules>

And then I repeat the wordpress rule in webroot/test but I gave it the name test worpress.

Any help is much appreciated.

 


Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>