从一个特定的文件夹中使用的htaccess删除SSL一体化 [英] Remove SSL integration from a specific folder using htaccess

查看:133
本文介绍了从一个特定的文件夹中使用的htaccess删除SSL一体化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个集成的SSL为我的整个网站,并已放置的htaccess code重定向到https当有人访问我的域名URL。但我想保持一个文件夹出这个重定向到https的。请帮我这个......下面是htaccess的code摆在我的根重定向所有请求到https对口

I have an integrated SSL for my entire site and have placed htaccess code to redirect to https when anyone visits my domain URL. But I want to keep one folder out of this redirection to https. Please help me with this... Below is the htaccess code placed in my root to redirect all requests to https counterpart

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

感谢

推荐答案

只需添加一个条件,以排除该文件夹:

Just add a condition to exclude the folder:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/folder1
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

如果你想将SSL请求重定向到非SSL为 /文件夹1 ,那么:

RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} ^/folder1
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

这篇关于从一个特定的文件夹中使用的htaccess删除SSL一体化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆