重定向从HTTPS单页到HTTP [英] Redirect a single page from HTTPS to HTTP

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

问题描述

我有一个完全运行在HTTPS站点。且有不需要在HTTPS来加载的文件。因此,我试图从htaccess的重定向,但它没有工作。

I have a site that fully runs on HTTPS. And there is a file that does not need to be loaded in HTTPS. Therefore I tried to redirect it from htaccess but it didnt work.

RewriteCond %{HTTPS} on
RewriteRule ^xml$ http://mysite/api.php [L,R=301]

下面是我尝试了线,但他们没有工作。

Here are the lines I tried but they did not work.

我想这也是阴性。 <一href="http://stackoverflow.com/questions/13156574/https-to-http-htaccess-redirect-for-home-page-only">HTTPS以HTTP htaccess的重定向首页只

推荐答案

你可以只使用一个简单的301重定向。只要把这个在你的.htaccess

you could just use a simple 301 redirect. Just put this in your .htaccess

redirect 301 /api.php http://mysite/api.php

这应该工作监守,它只是采取api.php文件在任的https或http并告诉它去

That should work becuase it's just taking the api.php file on either https or http and telling it to go to

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

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