如何将 HTTPS 重定向到 HTTP? [英] How do you redirect HTTPS to HTTP?

查看:128
本文介绍了如何将 HTTPS 重定向到 HTTP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您如何将 HTTPS 重定向到 HTTP?.也就是说,与(表面上)每个人所教的相反.

How do you redirect HTTPS to HTTP?. That is, the opposite of what (seemingly) everyone teaches.

我有一个使用 HTTPS 的服务器,我为其支付了 SSL 认证费用,还有一个镜像,我没有购买并保留用于紧急情况,因此不值得获得认证.

I have a server on HTTPS for which I paid an SSL certification for and a mirror for which I haven't and keep around for just for emergencies so it doesn't merit getting a certification for.

在我客户端的桌面上,我有一些指向 http://production_serverhttps://production_server(都有效)的快捷方式.但是,我知道如果我的生产服务器出现故障,那么 DNS 转发就会启动,那些快捷方式上带有https"的客户端将盯着 https://mirror_server(这不起作用)) 和一个巨大的 Internet Explorer 7 红屏让我的公司感到不安.

On my client's desktops I have SOME shortcuts which point to http://production_server and https://production_server (both work). However, I know that if my production server goes down, then DNS forwarding kicks in and those clients which have "https" on their shortcut will be staring at https://mirror_server (which doesn't work) and a big fat Internet Explorer 7 red screen of uneasyness for my company.

不幸的是,我不能只是在客户端级别进行切换.这些用户对计算机非常了解:并且很可能会因为看到 HTTPS不安全"错误而惊慌失措(尤其是现在 Firefox 3 和 Internet Explorer 7 处理它的方式:FULL STOP,有点谢天谢地,但在这里对我没有帮助,哈哈).

Unfortunately, I can't just switch this around at the client level. These users are very computer illiterate: and are very likely to freak out from seeing HTTPS "insecurity" errors (especially the way Firefox 3 and Internet Explorer 7 handle it nowadays: FULL STOP, kind of thankfully, but not helping me here LOL).

非常简单 Apache 解决方案 http->https 重定向,但对我来说,我不能做相反的事情.

It's very easy to find Apache solutions for http->https redirection, but for the life of me I can't do the opposite.

想法?

推荐答案

这还没有经过测试,但我认为这应该可以使用 mod_rewrite

This has not been tested but I think this should work using mod_rewrite

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

这篇关于如何将 HTTPS 重定向到 HTTP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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