Apache 是否可以将我的网站的特定页面(使用https)重定向到http?
目标 我想将我网站的特定页面重定向到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
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]回答得好,拉文德辛格!