ib bellad

ib bellad

  • 1.4k
  • 376
  • 35.2k

url rewritting in iis 7

Aug 10 2017 7:30 AM
Hi,
 
I wann redirect the url from https://www.subdomain.domain.com or www.subdomain.domain.com to https://www.subdomain.domain.com. When user enter the URL with "www" its showing 'privacy error' and i had purchased the wildcard ssl certificate. and also wriitten code in web.config file:
  1. <rewrite>  
  2. <rule name="Remove WWW and Ensure HTTPS" stopProcessing="false">  
  3. <match url="^(.*)$" />  
  4. <conditions logicalGrouping="MatchAny">  
  5. <add input="{HTTP_HOST}" pattern="^(www\.)" />  
  6. <add input="{HTTPS_HOST}" pattern="^https://www\.(.*)\.(.*)\.(.*)$" />  
  7. <add input="{HTTPS}" pattern="^OFF$" />  
  8. </conditions>  
  9. <serverVariables />  
  10. <action type="Redirect" url="https://{HTTPS_HOST}{REQUEST_URI}" />  
  11. </rule>  
  12. </rules>  
  13. </rewrite>  
Thanks in Advance

Answers (2)