2017-09-01 130 views
0

我在這裏很掙扎。我已經看到了80到443的很多答案,但我真的堅持用我們的控制面板8880到8443。IIS將端口8880上的http重定向到端口8443上的https

需要重定向URL的一個例子:http://udweb01.servers.unreal-designs.co.uk:8880/admin/home?context=home

應該導致這樣:https://udweb01.servers.unreal-designs.co.uk:8443/admin/home?context=home

注意HTTP - > HTTPS和8880 - > 8443

目前的規則,我們有是這樣的:

<rule name="Force SSL (8443)" enabled="true" stopProcessing="true"> 
    <match url="^(http://)?(.*):8880(/.*)?$" /> 
    <action type="Redirect" url="https://{R:2}:8443{R:3}" appendQueryString="true" redirectType="Found" /> 
</rule> 

但是,這似乎並沒有做任何事情。有任何想法嗎?

回答

1

您的規則應該是這樣的:

<rule name="Redirect with port" stopProcessing="true"> 
    <match url=".*" /> 
    <conditions> 
      <add input="{HTTP_HOST}" pattern="^(.*):8880$" /> 
    </conditions> 
    <action type="Redirect" url="https://{C:1}:8443/{R:0}" /> 
</rule> 

在這個規則,你必須條件<add input="{HTTP_HOST}" pattern="^(.*):8880$" />將ACCET僅HTTP主機與端口8880

相關問題