如题所述
web.config åæ³å¦ä¸ï¼
<system.webServer>
<rewrite>
<rules>
<rule name="ååéå®å301" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="^mysite\.com$" />
</conditions>
<action type="Redirect" url="http://www.mysite.com/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
===========================
å½å¨æµè§å¨è¾å ¥ http://mysite.com/xxx.html æ¶åï¼
éå®å为
http://www.mysite.com/xxx.html
è¿æ¯æ£ç¡®ç 没éã追é®
<system.webServer>
<rewrite>
<rules>
<rule name="ååéå®å301" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="^mysite\.com$" />
</conditions>
<action type="Redirect" url="http://www.mysite.com/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
===========================
å½å¨æµè§å¨è¾å ¥ http://mysite.com/xxx.html æ¶åï¼
éå®å为
http://www.mysite.com/xxx.html
è¿æ¯æ£ç¡®ç 没éã追é®
å¦ææåªæ¯æ³æ http://mysite.com/aaa/xxx.html跳转å°http://www.mysite.com/aaa.htmlï¼ä½æ¯http://mysite.com/bbb.xxx.htmlä¸ç¨è·³è½¬ï¼å¯ä»¥åï¼å¦æå¯ä»¥çè¯ï¼è¦æä¹åï¼
温馨提示:答案为网友推荐,仅供参考