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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.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
Apache 是否可以将我的网站的特定页面(使用https)重定向到http?_Apache_.htaccess_Http_Mod Rewrite_Url Rewriting - Fatal编程技术网

Apache 是否可以将我的网站的特定页面(使用https)重定向到http?

Apache 是否可以将我的网站的特定页面(使用https)重定向到http?,apache,.htaccess,http,mod-rewrite,url-rewriting,Apache,.htaccess,Http,Mod Rewrite,Url Rewriting,目标 我想将我网站的特定页面重定向到http 背景 我有以下几点 Options All -Indexes RewriteEngine On RewriteRule ^(.*)\.html $1\.php [L] RedirectMatch ^/*$ https://**mydomain_name**/files/index.php Options +SymLinksIfOwnerMatch RewriteCond %{REQUEST_FILENAME} !-f RewriteCo

目标

我想将我网站的特定页面重定向到http

背景

我有以下几点

Options All -Indexes
RewriteEngine On 
RewriteRule ^(.*)\.html $1\.php [L]
RedirectMatch ^/*$  https://**mydomain_name**/files/index.php   
Options +SymLinksIfOwnerMatch 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /files/error.php [L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
这允许我将所有内容重定向到https(这很好地工作)

问题


是否可以将包含内部(https://mydomain\u name/internal/)地址的所有页面重定向到http(而不是https)?

更好的是,我们可以保持不处理包含Innal的URI请求的条件,而不是首先将它们重定向到https,然后针对特定提到的URI返回http

Options All -Indexes
RewriteEngine On 
RewriteRule ^(.*)\.html $1\.php [L]
RedirectMatch ^/*$  https://**mydomain_name**/files/index.php   
Options +SymLinksIfOwnerMatch 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /files/error.php [L]
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/internal [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

令人惊叹的!我没有重写cond%{REQUEST_URI}!^/[NC]回答得好,拉文德辛格!