簡體   English   中英

使用IIS和ISAPI重寫強制HTTPS

[英]Forcing HTTPS using IIS and ISAPI Rewrite

我正在努力強制使用HTTPS,如果用戶使用的是HTTP,請重定向用戶。 出於某種原因,我的重寫規則在我的產品環境中工作得很好,但在我的開發人員中卻不行,這里是:

# Redirect HTTP to HTTPS# redirect all http requests  to https
RewriteCond  %HTTPS (?!on).*
RewriteCond Host: (.*)
RewriteRule (.*) https\://$1$2 [I,RP]

在Prod上效果很好,它可以重定向用戶。 在Dev上,它不會顯示以下非常奇怪的頁面:

-cache
Content-Type: text/html
Content-Length: 161
Location: https://blahblah.mainblah.com/

<html><body>The requested resource was moved. It could be found here: <a href="https://blahblah.mainblah.com/">https://dev-notebox.intuit.com/</a></body></html>

有沒有人看到這件事或對這里發生的事情有任何想法/指針?

謝謝

如果從http請求頁面,則可以使用<cflocation>而不是使用重寫。 檢查Application.cfc的onRequestStart() CGI范圍。 適用於所有Web服務器的純CFML解決方案。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM