WordPress Multi-Site

Discussion in 'Domain names / DNS' started by IRIS, Aug 7, 2018.

  1. Hello,

    I have two installations of WordPress running correctly in two sub folders:
    /Wordpress/
    /wordpress2/

    I tried to add Multi-Site to the wordpress site in folder /wordpress2/ so I can add a third domain without having to add another installation of wordpress. If all works well, I will move all sites to the /wordpress2/ installation.
    So this is what I cannot get to work:
    FirstDomain.com redirects to /wordpress/ installation of wordpress and displays the for FirstDomain.com(this is working)
    Domain1.com redirects to /wordpress2/ installation of wordpress and displays the site for domain1.com
    Domain2.com redirects to /wordpress2/ installation of wordpress and displays the site for domain2.com

    Once domain1,com and domain2.com are working, I will move firstdomain.com to the wordpress installation in /wordpress2/ directory and then delete the /worpress/ installation.

    I have pointers for all domains
    From what I have read, this is pretty easy with an Apache server but I just cannot get this working on Discount ASP. I put a support request in and they told me I had to go to the community.
    I would really appreciate any help here because I am stuck.
     
  2. Hello,

    I would really appreciate if someone can point me in the right direction on this. I have tried many suggestions I found out on the web but none seem to work. Please help
     
  3. martino

    martino DiscountASP.NET Staff

    In order to use Multi Site WordPress on our IIS Server. You need to use the following URL Rewrite rule within the web.config file of the WordPress site.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <rewrite>
                <rules>
     
            <clear />
            <!--
                    <rule name="Redirect to https" stopProcessing="true">
                        <match url="(.*)" />
                        <conditions>
                            <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                        </conditions>
                        <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
                    </rule>
    -->
            
                     <rule name="WordPress Rule 1" stopProcessing="true">
                        <match url="^index\.php$" ignoreCase="false" />
                        <action type="None" />
                    </rule>
                    <rule name="WordPress Rule 2" stopProcessing="true">
                        <match url="^([_0-9a-zA-Z-]+/)?files/(.+)" ignoreCase="false" />
                        <action type="Rewrite" url="wp-includes/ms-files.php?file={R:2}" appendQueryString="false" />
                    </rule>
                    <rule name="WordPress Rule 3" stopProcessing="true">
                        <match url="^([_0-9a-zA-Z-]+/)?wp-admin$" ignoreCase="false" />
                        <action type="Redirect" url="{R:1}wp-admin/" redirectType="Permanent" />
                    </rule>
                    <rule name="WordPress Rule 4" stopProcessing="true">
                        <match url="^" ignoreCase="false" />
                        <conditions logicalGrouping="MatchAny">
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" />
                        </conditions>
                        <action type="None" />
                    </rule>
                    <rule name="WordPress Rule 5" stopProcessing="true">
                        <match url="(^[_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)" ignoreCase="false" />
                        <action type="Rewrite" url="{R:2}" />
                    </rule>
                    <rule name="WordPress Rule 6" stopProcessing="true">
                        <match url="^([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
                        <action type="Rewrite" url="{R:2}" />
                    </rule>
                    <rule name="WordPress Rule 7" stopProcessing="true">
                        <match url="." ignoreCase="false" />
                        <action type="Rewrite" url="index.php" />
                    </rule>
     
                </rules>
            </rewrite>
            <defaultDocument>
                <files>
                    <clear />
                    <add value="index.php" />
                    <add value="Default.htm" />
                    <add value="Default.asp" />
                    <add value="index.htm" />
                    <add value="index.html" />
                    <add value="iisstart.htm" />
                    <add value="default.aspx" />
                </files>         
            </defaultDocument>
            
        </system.webServer>
    </configuration>
     
    RayH likes this.
  4. Sorry for the delay, I was not working for a while.
    So this would replace the web.config file in the folder where worpress is installed?
    Don't I also need to edit the web.config file in the root directory to redirect to the sub folder where wordpress resides?
     
  5. martino

    martino DiscountASP.NET Staff

    You need to replace the URL Rewrite rule within the web.config file of the default web.config file that Wordpress comes with. With the code I provided. This will allow the Multi Site WordPress work correctly on our IIS server.
     
    RayH likes this.

Share This Page