2013-02-13 25 views
5

http: // http://www.microsoft.com/downloads/index.htm adresinde bulunan bazı dosyalara sahibim. Aşağıdaki kodu denedim ancak çalışmaz. nasıl sayfalar page1 için kuvvet HTTP, web.config Page2 set can pencerelerde PHP uygulaması için IIS 7 web sunucusu çalışanWeb.config dosyasındaki bazı dosyalar için http'u nasıl zorlarım

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <system.webServer> 
    <rewrite> 
     <rules> 
      <rule name="Force HTTP" stopProcessing="true"> 
       <match url="(.*)/page1.php" ignoreCase="false"/> 
           <match url="(.*)/page2.php" ignoreCase="false"/> 
       <conditions> 
        <add input="{HTTPS}" pattern="ON" ignoreCase="true"/> 
       </conditions> 
       <action type="Redirect" url="http://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" /> 
      </rule> 
     </rules> 
    </rewrite> 
    </system.webServer> 
</configuration> 

Iam

Bu hizmeti kullanmak için kuralını değiştirmek gerekir

cevap

3

:

<rule name="Force HTTP" stopProcessing="true"> 
    <match url="^page[12].php(.*)" /> 
    <conditions> 
    <add input="{HTTPS}" pattern="^ON$" /> 
    </conditions> 
    <action type="Redirect" url="http://{HTTP_HOST}/{R:0}" redirectType="Permanent" /> 
</rule> 

url="^page[12].php(.*)", page1.php veya page2.php ile başlayan tüm URL'lerle eşleşecektir.
Eylem, isteği {R:0} istenilen yolu içeren https://{HTTP_HOST}/{R:0} adresine yönlendirir.

+0

Teşekkürler ... :). Farklı sayfalar için kastediyorum (onpage, anoher page). Eşleşme etiketini Olarak değiştirdim. Ayrıca yönlendirme https yerine http. Şimdi iyi çalışıyor. Bir kez daha çok teşekkür ederim. – suneesh

+0

@suneesh Sağ, HTTPS'ye yönlendirme bir yazım hatasıydı! Afedersiniz :) – cheesemacfly

İlgili konular