简体   繁体   English

允许使用apache HTACCESS在https页面上使用http iframe

[英]allow http iframe on a https page with apache HTACCESS

I have a problem with the HTACCESS 我对HTACCESS有问题

I have a web page with an SSL certificate, for example https:// www. 我有一个带有SSL证书的网页,例如https:// www。 example.com example.com

Then i have to inject an iframe from other company on my web. 然后,我必须在网络上注入其他公司的iframe。 The iframe is not https, its just http and the other company is not about to change this. iframe不是https,只是http,而其他公司则不会更改。

So i have to allow on my htaccess this iframe. 因此,我必须允许在htaccess上使用此iframe。

I put this iframe on a page that cannot be http 我将此iframe放在了不能是http的页面上

for example, if my entire web is https:// www. 例如,如果我的整个网站是https:// www。 example.com i want to turn https:// www. example.com我想转https:// www。 example.com/en/potato to http:// www. example.com/en/potato到http:// www。 example.com/en/potato so i will can inject the http iframe. example.com/en/potato,以便我可以注入http iframe。

I've tried to do 我试着做

RewriteCond %{HTTPS} off
RewriteCond %{THE_REQUEST}  !^/en/potato$ [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
RewriteEngine on

RewriteCond %{HTTPS} on
RewriteCond %{THE_REQUEST} ^/en/potato$ [NC]
RewriteRule ^(.*)$ http://xxx.example.com/en/potato [R=301,L]

Any sugestion? 有什么建议吗?

Also the web is made on php 网络也是在php上制作的

Thanks! 谢谢!

You can't allow an http iframe in an https webpage. 您不能在https网页中使用http iframe。 If you include an https webpage that redirect to http, it will be blocked too. 如果您包含一个重定向到http的https网页,它也会被阻止。

What you can do it try to proxy the content of the iframe through an https server, or ask nicely the owner of the http webpage to add https to his website. 您可以执行哪些操作尝试通过https服务器代理iframe的内容,或者很好地要求http网页的所有者向其网站添加https。

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

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