lilmer Posted November 7, 2014 Share Posted November 7, 2014 Anyone know how to force URL with SSL with www. <rewrite> <rules> <rule name="Redirect to HTTPS" stopProcessing="true"> <match url="(.*)" /> <conditions><add input="{HTTPS}" pattern="^OFF$" /> </conditions> <action type="Redirect" url="https://www.site.com/{R:0}" redirectType="SeeOther" /> </rule> </rules> </rewrite> Please check the sample. http://site.com to https://www.site.com http://www.site.com to https://www.site.com But when https://site.com to https://site.com it doesn't add www on the site URL.Anyone can help me. Link to comment https://forums.phpfreaks.com/topic/292332-force-www-on-https/ Share on other sites More sharing options...
jeffreyappel Posted April 11, 2015 Share Posted April 11, 2015 Anyone know how to force URL with SSL with www. <rewrite> <rules> <rule name="Redirect to HTTPS" stopProcessing="true"> <match url="(.*)" /> <conditions><add input="{HTTPS}" pattern="^OFF$" /> </conditions> <action type="Redirect" url="https://www.site.com/{R:0}" redirectType="SeeOther" /> </rule> </rules> </rewrite>Better try this: <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="Add www" patternSyntax="Wildcard" stopProcessing="true"> <match url="*" /> <conditions> <add input="{HTTP_HOST}" pattern="www.fabrikam.com" negate="true" /> </conditions> <action type="Redirect" url="http://www.fabrikam.com/{R:1}" /> </rule> </rules> </rewrite> </system.webServer> </configuration> Link to comment https://forums.phpfreaks.com/topic/292332-force-www-on-https/#findComment-1508789 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.