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 如何将https文件重定向到http文件_.htaccess_Mod Rewrite_Redirect - Fatal编程技术网

.htaccess 如何将https文件重定向到http文件

.htaccess 如何将https文件重定向到http文件,.htaccess,mod-rewrite,redirect,.htaccess,Mod Rewrite,Redirect,我想使用此代码将所有页面从https重定向到http RewriteEngine On RewriteCond %{HTTPS} on RewriteRule ^(.*)$ http://aplauz.media.pl/$1 [R=301,L] 它起作用了 我想同时将特定文件https重定向到http Redirect 301 /aktualnosci/155-rusza-kampania-promujaca-w-polsce-rosji-i-chinach/ http://aplauz.m

我想使用此代码将所有页面从https重定向到http

RewriteEngine On
RewriteCond %{HTTPS} on 
RewriteRule ^(.*)$ http://aplauz.media.pl/$1 [R=301,L]
它起作用了

我想同时将特定文件https重定向到http

Redirect 301 /aktualnosci/155-rusza-kampania-promujaca-w-polsce-rosji-i-chinach/ http://aplauz.media.pl/blog/rusza-kampania-promujaca-w-polsce-rosji-chinach/
它也能工作

但决不能两者兼而有之,因为浏览器会通知我双重重定向。 有人能帮我吗?

你可以使用:

RewriteEngine On

RewriteRule ^aktualnosci/155-rusza-kampania-promujaca-w-polsce-rosji-i-chinach/ http://aplauz.media.pl/blog/rusza-kampania-promujaca-w-polsce-rosji-chinach/ [L,NC,R=302]

RewriteCond %{HTTPS} on
RewriteRule ^ http://aplauz.media.pl%{REQUEST_URI} [R=302,NE,L]

i、 e.在通用的“一网打尽”规则之前保留特定的重定向规则。

我还不知道你到底在问什么,什么在起作用,什么不起作用。很简单:两个重定向都不起作用。重写规则^.*$[R=301,L]重定向301/aktualnosci/155-rusza-kampania-promujaca-w-polsce-rosji-i-chinach/