0

当有人点击网址http://www.makememyvideo.com/dev/fr/project/9/1.php时,我想将 http 重定向到 https ,所以它应该是https://www.makememyvideo.com/dev/ fr/project/9/1.php

我正在使用这样的htaccess重定向方法,htaccess文件在文件夹9中

   Options -Multiviews
  <IfModule mod_rewrite.c>
   RewriteEngine On
   #RewriteBase  /fr/project/9

     RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://www.makememyvideo.com/dev/project/fr/9/$1 [R,L]

RewriteCond %{THE_REQUEST} ^GET\ /[^?\s]+\.php
RewriteRule (.*)\.php$ /fr/project/9/$1/ [L,R=301]

RewriteRule (.*)/$ /fr/project/9/$1.php [L]

RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule .*[^/]$ /fr/project/9/$0/ [L,R=301]

RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [L]

但它给出了一个重定向循环错误,我在文件夹项目和文档根目录中有 htaccess 文件。

任何帮助将不胜感激

谢谢

4

2 回答 2

1

这在我的网站上工作

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^ https://www.xxxxxx.com%{REQUEST_URI} [NC,L,R=301,NE]
于 2020-02-12T02:07:26.290 回答
0

试试这些行:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule - https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L,R=301]
于 2013-09-10T14:12:50.487 回答