• Resolved azcurlygurl

    (@azcurlygurl)


    I’m installing new WP sites on subdirectories for one hosting account. The previous web developer wrote a rule in the hosted domain’s web.config to redirect all url’s from http to https. This is causing loop errors on the domains I need to install WP. I do not know XML. I looked up XML schema and metacharacters and changed to code to only apply the rule to specific sites. This change took all the sites down.

    Is there an easier way to do this? Maybe in the wp.config file of each domain? I don’t have access to the existing WP sites created by the former developer.

    If the web.config file is the only option, what have I done wrong?

    Original code:

    <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>

    Modified code:

    <rule name="Redirect to https" stopProcessing="true">
                        <match url="(*global*.*|sitename.com)" />
                        <conditions>
                            <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                        </conditions>
                        <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
                    </rule>
Viewing 1 replies (of 1 total)
  • Thread Starter azcurlygurl

    (@azcurlygurl)

    I’ve gone back and forth with the hosting provider. I don’t know what they did, but they all work fine now.

Viewing 1 replies (of 1 total)
  • The topic ‘Web.config HTTPS redirect causing loop errors’ is closed to new replies.