使用.htaccess文件无效的HTTP到HTTPS重定向

时间:2018-05-14 12:47:00

标签: .htaccess http https server http-status-code-301

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

ErrorDocument 404 https://whatmovieshouldiwatchtoday.com/error404.php

php_flag display_errors 1

RewriteEngine On
RewriteRule ^/?movie/([0-9A-Za-z-:-]+)/?$ /movie.php?id=$1 [NC,L] 

RewriteEngine On
RewriteRule ^/?cast/([0-9A-Za-z-:-]+)/?$ /cast.php?cast=$1 [NC,L] 

RewriteEngine On
RewriteRule ^/?keyword/([0-9A-Za-z-:-]+)/?$ /keyword.php?keyword=$1 [NC,L] 

这是我的代码,现在这部分代码应该将HTTP重定向到https,但它无法正常工作:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

当我尝试打开我的网站时(即使使用https),Google Chrome会显示"等待Whatmovieshouldiwatchtoday.com"几秒钟后,显示

  

此页面无效

     

whatmovieshouldiwatchtoday.com重定向了你太多次了。

     

尝试清除Cookie。

     

ERR_TOO_MANY_REDIRECTS

0 个答案:

没有答案