I've just set up SSL on a domain, as recommended by Google, and need to set up the web.config to 301 http to https, I've added the code recommended 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" />