URL Rewrite pravidla: Porovnání verzí

Z ASPone Help Wiki
Přejít na: navigace, hledání
Řádka 16: Řádka 16:
  
 
<h2>Přesměrování z BEZ WWW na WWW a z HTTP na HTTPS</h2>
 
<h2>Přesměrování z BEZ WWW na WWW a z HTTP na HTTPS</h2>
 +
 
  <system.webServer>
 
  <system.webServer>
 
   <rewrite>
 
   <rewrite>
 
     <rules>
 
     <rules>
<rule name="Force WWW and SSL" enabled="true" stopProcessing="true">
+
      <rule name="Force WWW and SSL" enabled="true" stopProcessing="true">
<match url="(.*)" />
+
<match url="(.*)" />
 
  <conditions logicalGrouping="MatchAny">
 
  <conditions logicalGrouping="MatchAny">
 
       <add input="{HTTP_HOST}" pattern="^[^www]" />
 
       <add input="{HTTP_HOST}" pattern="^[^www]" />
Řádka 26: Řádka 27:
 
  </conditions>
 
  </conditions>
 
   <action type="Redirect" url="https://www.test.cz/{R:1}" appendQueryString="true" redirectType="Permanent" />
 
   <action type="Redirect" url="https://www.test.cz/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
+
      </rule>
 
     </rules>
 
     </rules>
 
   </rewrite>
 
   </rewrite>
 
  </system.webServer>
 
  </system.webServer>

Verze z 23. 8. 2022, 09:58

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í z BEZ WWW na WWW a z HTTP na HTTPS

<system.webServer>
 <rewrite>
   <rules>
     <rule name="Force WWW and SSL" 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.test.cz/{R:1}" appendQueryString="true" redirectType="Permanent" />
     </rule>
   </rules>
 </rewrite>
</system.webServer>
Osobní nástroje
Jmenné prostory

Varianty
Akce
Navigace
Znalostní báze
Domény
ASPone.cz
Nástroje