2016-12-17 77 views
1

在頁面加載現在在.htaccess中添加最後三行代碼後,我得到的網頁-URL重定向你太多次的錯誤。Url重定向了太多次。我該如何解決它

Options -Indexes 
ErrorDocument 403 http://example.com/404/errorPage.php 
RewriteEngine On 
RewriteCond %{HTTPS} !=on 
# also tried - RewriteCond %{HTTPS} off 
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 
+0

此服務器是負載均衡器還是反向代理服務器? –

+0

我在gadaddy上使用共享託管並將名稱服務器更改爲cloudflare。 – manish5310277

回答

0

您可能需要添加+FollowSymLinks

因此,這將是..

Options -Indexes 
+FollowSymLinks 
ErrorDocument 404 http://example.com/404/errorPage.php 
RewriteEngine On 
RewriteCond %{HTTPS} off 
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 
+0

添加+ FollowSymLinks給我內部服務器錯誤。 – manish5310277

+0

你的rewritebase看起來像什麼?你想重定向到https嗎? –

+0

我在godaddy中使用公共根目錄,是的,我試圖重定向到https。 – manish5310277

0

嘗試:

RewriteEngine On 
RewriteCond %{HTTP:X-Forwarded-Proto} !https 
RewriteRule^https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 
0

,我發現這個網址here在CloudFlare的創造頁面規則這對我的工作都是爲了你的努力。

相關問題