2017-06-16 31 views
0

我有一個運行https的網站。現在一些程序員需要一個沒有https的子碼。可能從https重寫排除子文件夾?

這就是我在我的web.config現在:

<rule name="HTTP Redirect to HTTPS" enabled="true" stopProcessing="true"> 
    <match url="(.*)" ignoreCase="false" /> 
    <conditions> 
     <add input="{HTTPS}" pattern="off" /> 
    </conditions> 
    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" /> 
</rule> 

我們需要從這個HTTPS排除的文件夾「的wp-content \休息」重定向。

希望有人能幫助我這個。

回答

0

您需要添加一個附加條件到您的規則:

<rule name="HTTP Redirect to HTTPS" enabled="true" stopProcessing="true"> 
    <match url="(.*)" ignoreCase="false" /> 
    <conditions> 
     <add input="{HTTPS}" pattern="off" /> 
     <add input="{REQUEST_URI}" pattern="^/wp-content/rest" negate="true" /> 
    </conditions> 
    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" /> 
</rule> 

則此規則將禁止重定向到像http://www.example.com/wp-content/rest*

所有URL
相關問題