1

I have a website on vps and set https on it. but when users open site with www, get error 403 - Forbidden: Access is denied.

I want when users open www.tavanyar.ir website goes redirect to https://tavanyar.ir

please help me to set my web.config

8611670474
  • 344
  • 1
  • 3
  • 12

1 Answers1

0
<rule name="RedirectWwwToNonWww" stopProcessing="false">
  <match url="(.*)" />
  <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
    <add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" />
  </conditions>
  <action type="Redirect" url="https://{C:2}{REQUEST_URI}" redirectType="Permanent" />
</rule>

read more about that

8611670474
  • 344
  • 1
  • 3
  • 12