我的情況在大多數情況下可以在我的安全站點重定向到https://mysite.example.com
,除非用戶輸入https://10.10.10.10
,在這種情況下會發生證書錯誤,這是很好的和預期的。但是,如果用戶決定繼續,我想重定向到我的安全網站。這可能嗎。看下面我的代碼。使用SSL的Apache重寫IP
RewriteEngine On
RewriteCond %{HTTP_HOST} ^10\.10\.10\.10$
RewriteRule ^(.*)$ `https://mysite.example.com`/$1 [L,R=301]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
是的,這是可能的。你的樣品似乎很好 – huydq5000