0
我試圖強制兩個http頁面https。當我做的登錄頁面,它完美的作品:RewriteRule第一條規則的作品,第二條規則不重定向到https
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^login\.htm$ https://www.sample.com/dev/login.htm [R=301,NC,L]
然而,當我試圖添加第二頁,我得到這個服務器錯誤:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^login\.htm$ https://www.sample.com/dev/login.htm [R=301,NC,L]
RewriteRule ^register\.htm$ https://www.sample.com/dev/register.htm [R=301,NC,L]
顯然,出事了。所以我改成了簡單重定向第二頁,而不是重寫規則上:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^login\.htm$ https://www.sample.com/dev/login.htm [R=301,NC,L]
Redirect ^register\.htm$ https://www.sample.com/dev/register.htm [R=301,NC,L]
該網站又回來了,但第二頁沒有強制HTTPS的。我已經檢查了所有,它應該工作,但它不。感謝您的幫助。