Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess:最简单的重定向会产生太多重定向_.htaccess - Fatal编程技术网

.htaccess:最简单的重定向会产生太多重定向

.htaccess:最简单的重定向会产生太多重定向,.htaccess,.htaccess,这是我在.htaccess中的简单规则(我想将仅1个url重定向到其https版本): 但这给了我 net::ERR\u太多\u重定向 你正在那里创建一个无限重定向。请尝试以下方法: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule gateway\.php https://www.example.com/gateway.php [R=302,L] 确保已加载mod_rewrite RewriteEngine On RewriteCon

这是我在.htaccess中的简单规则(我想将仅1个url重定向到其https版本):

但这给了我

net::ERR\u太多\u重定向


你正在那里创建一个无限重定向。请尝试以下方法:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule gateway\.php https://www.example.com/gateway.php [R=302,L]
确保已加载
mod_rewrite

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule gateway\.php https://www.example.com/gateway.php [R=302,L]