URL Rewrite pravidla: Porovnání verzí
Z ASPone Help Wiki
Řádka 20: | Řádka 20: | ||
<rewrite> | <rewrite> | ||
<rules> | <rules> | ||
− | <rule name=" | + | <rule name="WWW and HTTPS" enabled="true" stopProcessing="true"> |
<match url="(.*)" /> | <match url="(.*)" /> | ||
<conditions logicalGrouping="MatchAny"> | <conditions logicalGrouping="MatchAny"> |
Verze z 23. 8. 2022, 09:06
Přesměrování z HTTP na HTTPS
<system.webServer> <rewrite> <rules> <rule name="HTTPS Redirect" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="^OFF$" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" appendQueryString="false" /> </rule> </rules> </rewrite> </system.webServer>
Přesměrování bez www na www a na HTTPS
<system.webServer> <rewrite> <rules> <rule name="WWW and HTTPS" enabled="true" stopProcessing="true"> <match url="(.*)" /> <conditions logicalGrouping="MatchAny"> <add input="{HTTP_HOST}" pattern="^[^www]" /> <add input="{HTTPS}" pattern="off" /> </conditions> <action type="Redirect" url="https://www.vasedomena.cz/{R:1}" appendQueryString="true" redirectType="Permanent" /> </rule> </rules> </rewrite> </system.webServer>