简体   繁体   中英

Forcing HTTPS using IIS and ISAPI Rewrite

I'm working to force HTTPS, and if the user is on HTTP, redirect the user. For some reason My rewrite rule works great on my prod env but not my dev, here it is:

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

On Prod it works great, it redirects the user. On Dev, it does not but shows this very strange page:

-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>

Has anyone seen this or have any ideas/pointers on what's going on here?

Thanks

Instead of using rewrite, you can use <cflocation> if the page is requested from http. Check CGI scope in Application.cfc's onRequestStart() . Pure CFML solution that would work across all web servers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM