Title: Web.config HTTPS redirect causing loop errors
Last modified: August 30, 2016

---

# Web.config HTTPS redirect causing loop errors

 *  Resolved [azcurlygurl](https://wordpress.org/support/users/azcurlygurl/)
 * (@azcurlygurl)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/webconfig-https-redirect-causing-loop-errors/)
 * 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](https://wordpress.org/support/users/azcurlygurl/)
 * (@azcurlygurl)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/webconfig-https-redirect-causing-loop-errors/#post-6534348)
 * 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.

## Tags

 * [HTTPS](https://wordpress.org/support/topic-tag/https/)
 * [redirect](https://wordpress.org/support/topic-tag/redirect/)
 * [web.config](https://wordpress.org/support/topic-tag/web-config/)
 * [xml](https://wordpress.org/support/topic-tag/xml/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [azcurlygurl](https://wordpress.org/support/users/azcurlygurl/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/webconfig-https-redirect-causing-loop-errors/#post-6534348)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
