IIS7ÐèÒªÏÈÈ·ÈÏÊÇ·ñ°²×° ¡°URL REWRITE2 ¡± α¾²Ì¬Ä£¿é , Èç¹ûÄúÒѾ°²×°¿ÉÒÔÌø¹ý
URL REWIRTE £¨Î±¾²Ì¬Ä£¿é£©
ÏÂÔصØÖ· £º http://www.iis.net/downloads/microsoft/url-rewrite
µÚÒ»²½£º Ñ¡ÔñÕ¾µã£¬ ¡°URL ÖØд¡±,Èç¹û°²×°µÄÊÇÓ¢ÎÄ°æµÄ Ó¦¸ÃÊÇ¡¾Url rewrite¡¿
µÚ¶þ²½£º Ìí¼Ó ¡° ¿Õ°×¹æÔò¡±
µÚÈý²½£ºÌí¼Ó¹æÔò
Ãû³Æ £º HTTPS
Æ¥ÅäURL ģʽ£º (.*)
Ìí¼ÓÌõ¼þ£º Ìõ¼þ£º {HTTPS} ģʽ: off
²Ù×÷ÀàÐÍÑ¡Ôñ£ºÖض¨Ïò
Öض¨ÏòURL£º https://{HTTP_HOST}/{R:1}
È»ºó±£´æ¼´¿É
¸ß¼¶°æ£¨Ö±½Ó°Ñα¾²Ì¬Ìí¼Óµ½web.config£©
<?@xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>