2011-08-16 16 views

回答

1

是的,絕對。

你的URL重寫規則應該存儲在web.config文件(除非它明確禁止,這意味着它們將被存儲在IIS主配置文件 - 出於安全和性能的目的,我猜)。

這裏是這樣的web.config文件的例子:

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.webServer> 
     <rewrite> 
      <rules> 
       <clear /> 
       <rule name="Redirect to https" stopProcessing="true"> 
        <match url="(.*)" /> 
        <conditions> 
         <add input="{HTTPS}" pattern="off" ignoreCase="true" /> 
        </conditions> 
        <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="SeeOther" /> 
       </rule> 
       <rule name="CatchAll" enabled="false" stopProcessing="true"> 
        <match url="(.*)" /> 
        <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> 
         <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
         <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
        </conditions> 
        <action type="Rewrite" url="/catchall.php?page={REQUEST_URI}" /> 
       </rule> 
      </rules> 
     </rewrite> 
    </system.webServer> 
</configuration> 
+0

謝謝!有一件事不需要關心! – Pato