我發現有1000個其他主題需要這方面的幫助,但他們的解決方案似乎都沒有出於某種原因。在.htaccess中強制使用WWW和HTTPS(SSL)
幾天前我剛剛爲我的域名購買了SSL,因爲我接受我網站上的信用卡/支票卡,並希望我的客戶感到安全。
不管怎麼說,這是我的.htaccess文件看起來像此刻:
php_flag display_startup_errors off
php_flag display_errors off
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteRule ^buy-wow-accounts index.php [NC]
RewriteRule ^sell-wow-accounts sell.php [NC]
RewriteRule ^about-khaccounts about.php [NC]
RewriteRule ^buy-sell-wow-accounts-faq faq.php [NC]
RewriteRule ^khaccounts-feedback feedback.php [NC]
RewriteRule ^payment-plan payment-plan.php [NC]
RewriteRule ^customer-login customer-login.php [NC]
RewriteRule ^customer-center customer-center.php [NC]
RewriteRule ^privacy-policy privacy.php [NC]
RewriteRule ^buy-world-of-warcraft-wow-accounts/page-([0-9]+) listing.php?pageid=$1 [L,NC]
RewriteRule ^buy-world-of-warcraft-wow-accounts listing.php [L,NC]
RewriteRule ^world-of-warcraft-wow-acc/([^/]*)\.html$ account.php?acc=$1 [NC]
我想要做的就是力量WWW如果它不是已經在URL並確保HTTPS(SSL)的也是被迫的。我有很多鏈接到我的網站,其中大部分鏈接只是像「www.khaccounts.net」,「http://khaccounts.net」和「khaccounts.net」這樣的鏈接。
我想確保這些不同的舊鏈接中的每一個都被強制爲擁有WWW和HTTPS。換句話說,我希望人們擁有網址 - 'https://www.khaccounts.net',無論他們通過什麼URL訪問我的網站。
謝謝!
這不起作用。當我輸入'khaccounts.net'時,它會在URL中顯示'https://khaccounts.net//',並表示該頁面有重定向循環。 – user554095 2012-08-15 21:27:40