User-1646292712 posted
My web using code asp.net (C#) in visual studio 2015. My web using ssl not redirect https://www to none www hicc.
ex: https://www.trungtamthuoc.com error to
https://trungtamthuoc.com
while www.trungtamthuoc.com redirect good to https://trungtamthuoc.com
Code redirect in web.config : hellp me huhuhu
<rewrite>
<rules>
<rule name="Force non-WWW" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" />
<add input="{HTTPS_HOST}" pattern="^(www\.)(.*)$" />
</conditions>
<action type="Redirect" url="https://{C:2}/{R:1}" appendQueryString="true" />
</rule>
<rule name="Force HTTPS" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
