在某些虚拟目录中关闭SSL

时间:2012-05-25 23:39:43

标签: apache http .htaccess ssl https

我想在虚拟目录中关闭ssl - cron
一些需要通过http运行的网址是例如/ cron / one,/ cron / two或/ cron / three

我正在使用此重写强制ssl

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

一些例子,这里应该关闭:

/cron/one
/cron/two
/cron/three

一些帮助?

2 个答案:

答案 0 :(得分:0)

抱歉,无法为给定的uri禁用SSL。 这是鸡和蛋的问题。当客户端将GET / POST HTTP方法调用发送到包含请求的URI的服务器时,通道已加密。 可以使用 SSLEngine 指令为每个虚拟主机启用或禁用SSL。

您可以在127.0.0.1上以普通HTTP侦听方式创建专用虚拟主机来处理/ cron / URI,或者可以使用来自crontab的启用HTTPS的CLI HTTP客户端。

答案 1 :(得分:0)

在SSL VH中:

Redirect /cron/one http://your.domain/cron/one
Redirect /cron/two http://your.domain/cron/two
Redirect /cron/three http://your.domain/cron/three

将URL重定向到NON-SSL VH。

RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} ! /cron/one
RewriteCond %{REQUEST_URI} ! /cron/two
RewriteCond %{REQUEST_URI} ! /cron/three
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]