在windows2008下配置II7 web.config
當(dāng)通過手機(jī)訪問www域名時(shí),自動跳轉(zhuǎn)到對應(yīng)的移動域名下
- <?xml version="1.0" encoding="UTF-8"?>
- <configuration>
- <system.webServer>
- <!-- http://www.whsir.com 替換為對應(yīng)的網(wǎng)站,帶www-->
- <httpRedirect enabled="false" destination="http://www.whsir.com" exactDestination="false" childOnly="false" httpResponseStatus="Permanent" />
- <!--啟用Gzip壓縮-->
- <urlCompression doStaticCompression="true" doDynamicCompression="false" />
- <defaultDocument>
- <files>
- <clear />
- <add value="Default.htm" />
- <add value="Default.asp" />
- <add value="index.htm" />
- <add value="index.html" />
- <add value="index.php" />
- <add value="default.aspx" />
- </files>
- </defaultDocument>
- </system.webServer>
- <system.webServer>
- <rewrite>
- <rules>
- <rule name="WWW Redirect" stopProcessing="true">
- <match url=".*" />
- <conditions>
- <!--xxx.com,替換為對應(yīng)的網(wǎng)站,不帶www-->
- <add input="{HTTP_HOST}" pattern="^whsir.com$" />
- </conditions>
- <!-- http://www.whsir.com 替換為對應(yīng)的網(wǎng)站,帶www-->
- <action type="Redirect" url="http://www.whsir.com/{R:0}" redirectType="Permanent" />
- </rule>
- <rule name="Mobile Jump" stopProcessing="true">
- <match url="^(.*)$" />
- <conditions logicalGrouping="MatchAll">
- <add input="{HTTP_USER_AGENT}" pattern="(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino" />
- </conditions>
- <!-- 輸入要跳轉(zhuǎn)的手機(jī)站點(diǎn) -->
- <action type="Redirect" url="http://m.whsir.com/" redirectType="Found" />
- </rule>
- </rules>
- </rewrite>
- </system.webServer>
- </configuration>
版權(quán)聲明:文章圖片資源來源于網(wǎng)絡(luò),如有侵權(quán),請留言刪除!!!
評論