Forzare HTTPS utilizzando IIS e ISAPI Rewrite
-
30-09-2019 - |
Domanda
Sto lavorando a forzare HTTPS, e se l'utente si trova su HTTP, reindirizzare l'utente. Per qualche motivo il mio regola di riscrittura funziona alla grande sul mio prod ENV ma non il mio dev, qui è:
# Redirect HTTP to HTTPS# redirect all http requests to https
RewriteCond %HTTPS (?!on).*
RewriteCond Host: (.*)
RewriteRule (.*) https\://$1$2 [I,RP]
Il Prod E le grandi opere, si reindirizza l'utente. Su Dev, non è così, ma mostra questa strana pagina:
-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>
Qualcuno ha visto questo o avete qualunque idee / indicazioni su quello che sta succedendo qui?
Grazie
Soluzione
Invece di usare riscrittura, è possibile utilizzare <cflocation>
se la pagina viene richiesta da http. Controllare la portata CGI in onRequestStart()
di Application.cfc. soluzione pura CFML che avrebbe funzionato in tutti i server Web.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow