Skip to main content
Help Center
The GoDaddy Community will undergo maintenance starting on Tuesday, August 3rd at 3pm PST / 6pm EST. Learn more
Showing results for 
Show  only  | Search instead for 
Did you mean: 

301 http to https

I've just set up SSL on a domain and need to set up the web.config to 301 http to https, I've added the code recomeneded by Godaddy but that redirects every http page to the root https page whereas I need a one for one match plus non www. to www. redirect any help?

web.config file:


<?xml version="1.0" encoding="UTF-8"?>
<customErrors mode="Off"/>
<asp scriptErrorSentToBrowser="true"/>
<httpErrors errorMode="Detailed"/>
<rule name="wordpress" patternSyntax="Wildcard">
<match url="*"/>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
<action type="Rewrite" url="index.php"/>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
<action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />
<clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" />