0
我正在使用以下web.config文件將站點的非www版本重定向到www版本。不過,我也想讓它剝離索引文件的文件名稱。Windows Server Web.config條索引文件名
例如: 重定向到www.example.com/index.html www.example.com
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<rewrite>
<rules>
<rule name="CanonicalHostNameRule" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www\.example\.com$" negate="true" />
</conditions>
<action type="Redirect" url="http://www.example.com/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
編輯:
這裏是我的更新配置文件。但是,現在它造成了500錯誤。
如下:)
太好了!我怎麼做?哈 – Batfan 2010-11-18 18:27:17