繁体   English   中英

除了一系列网址外,还重定向到HTTPS

[英]Redirect to HTTPS except a series of URLs

我需要在一系列网址上推迟https ...

现在我得到了这个: https//sub.domain.com/release/download/ {id}

我需要将所有/ release / download / {id}网址重定向到http

我从这里尝试了几个解决方案: Mod_rewrite http-> https redirect EXCEPT一个URL

但都没有用。

我在apache conf中得到了这个:

RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]

您可以使用以下RewriteRule

RewriteEngine On
#redirect http to https except "/release/download/*
RewriteCond %{REQUEST_URI} !^/release/download/.*
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM