简体   繁体   English

https到http重定向两个页面

[英]https to http redirect for two pages

My site (WordPress, in case it's important) has ssl enabled with the following 'rewrite' rule in the htaccess file … 我的网站(在重要的情况下为WordPress)已启用ssl,并在htaccess文件中使用以下“重写”规则…

<IfModule mod_rewrite.c>
# RewriteEngine On
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
</IfModule>

I have two pages I would 'disable' ssl for … 我有两个页面会“禁用” ssl……

https://www.example.com/firstpage.php
https://www.example.com/someotherpage.php

The problem I have is that each of these pages has a highcharts chart on. 我遇到的问题是,每个页面上都有一个高图图表。 For some reason, the highcharts rendering server that is used for exports doesn't like the fact ssl is enabled on a page. 由于某些原因,用于导出的highcharts呈现服务器不喜欢在页面上启用ssl的事实。 This results in, horrible 'this is insecure' messages, and missing images when exporting a chart. 这会导致可怕的“这是不安全的”消息,并且在导出图表时会丢失图像。 Highcharts suggest here that a way to avoiding these issues is to, basically, build your own rendering engine … but I think this might be overkill. Highcharts 在这里建议避免这些问题的一种方法是,基本上是构建自己的渲染引擎……但是我认为这可能会过大。

So may I ask how I would remove ssl for the pages mentioned above. 因此,我想问一下如何删除上述页面的ssl。 I know you like to see something I have tried but I have two problems. 我知道您喜欢看我尝试过的东西,但是有两个问题。

  1. I think I may well, make some catastrophic mistake with this file and cause some real damage. 我想我可能会对此文件犯一些灾难性错误,并造成一些实际损失。

  2. I really don't know where to start, as I seem to be understanding very little of what I read here on SO. 我真的不知道从哪里开始,因为我似乎不太了解我在SO上读到的内容。 For example, I did try the following based on this question . 例如,我确实根据此问题尝试了以下方法。

     redirect 301 /firstpage.php http://example.com/firstpage/ 

May I ask SO for some pointers / help please ? 我可以问一下一些指示/帮助吗?

Try adding conditions to your existing rule so that those 2 pages don't get redirected to SSL: 尝试在现有规则中添加条件,以使这两个页面不会重定向到SSL:

<IfModule mod_rewrite.c>
# RewriteEngine On
RewriteCond %{REQUEST_URI} !^/firstpage\.php
RewriteCond %{REQUEST_URI} !^/someotherpage\.php
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
</IfModule>

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

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