我試圖在LAMP服務器上爲我的網站獲取SSL。當我在網站上輸入任何頁面地址作爲https://www.example.com時,它會被重定向到http://www.example.com。當我訪問HTTPS時,網站保持重定向到HTTP,無明顯原因
我認爲如果我可以讓服務器通過HTTPS,但它只是拒絕並始終更改爲HTTP,SSL就可以工作(或者至少我可以達到)。該網站利用Joomla!但我很確定它不相關,因爲:
我有另一個幾乎相同的Joomla!站點位於同一臺服務器上,並且SSL可以成功運行。
已驗證SSL證書,且證書有效且安裝正確。
沒有PHP重定向。
沒有的.htaccess重定向直接涉及HTTP/S等
的.htaccess
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule .* index.php [F]
RewriteRule ^order/payment(/?.*)$ /payment [R=301,L]
RewriteRule ^order/complete$ /index.php?option=com_cake&task=orders&id=complete [L]
RewriteRule ^order2$ /index.php?option=com_cake&task=orders&id=index [L]
RewriteRule ^order/2$ /index.php?option=com_cake&task=orders&id=index [L]
RewriteRule ^payment/(.+)$ /index.php?option=com_cake&task=payments&id=$1 [L]
RewriteRule ^admin/(.+)$ /index.php?option=com_cake&task=admin&id=$1 [L]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
那麼,爲什麼是網站重定向?有任何想法嗎?
對於任何知道Joomla的人!我試着安裝這個插件http://www.yireo.com/software/joomla-extensions/ssl-redirect,並嘗試啓用我的主頁上的'安全'選項,它不起作用。我認爲這是因爲它可能正在工作,但服務器再次重定向到HTTP,原因不明。
已經試過。它會導致無限的重定向循環,因爲我認爲每次都會導致HTTPS重定向回HTTP。 – BadHorsie