Facebook标签默认http通过https [英] facebook tab default http over https

查看:436
本文介绍了Facebook标签默认http通过https的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题一直都被问到,
我已经公开处理所有的https问题和所有这些..
但我现在的问题是当用户点击我的页面中的应用程序标签,并且其安全浏览选项被禁用,它们会自动重定向到https的http url。 (我的应用程序只能在https中使用)。



我尝试没有在页面选项卡URL中添加任何内容:在应用程序设置中以及将https URL放在那里,但是两个都不会工作...



如何使我的选项卡默认重定向到https url ??



PS
我也尝试通过这样的代码重定向:

  if($ _ SERVER ['HTTPS']!= on)
{
$ redirect =https://。$ _ SERVER ['HTTP_HOST']。$ _ SERVER ['REQUEST_URI'];
header(Location:$ redirect);
}

也是这样的:


$ b $如果(!$ _ SERVER ['HTTPS']){
header(HTTP / 1.1 301 Moved Permanently); b

  
header('Location:https:// [myappurl]');
退出;
}

但它没有工作



更新:解决问题

我需要在Facebook开发人员的应用程序设置上填写Facebook部分的应用程序。我不知道为什么,但它的工作。

解决方案


我的应用程序只能工作https你的意思是说,只会工作(在某种意义上说只能保证用户数据的安全),或者只能通过HTTPS访问


如何使我的选项卡默认重定向到https url?


用户选择通过HTTP浏览facebook.com,因此Facebook会将您的应用程序的HTTP版本加载到iframe中。因此,除非您至少有一个可通过HTTP访问的应用程序页面 - 您不能。如果您有这样的页面,请使用JavaScript重定向到HTTPS版本, top.location.href =https://www.facebook.com/...\"


I know this kind of question are asked all the time, I've mannaged to deal with all the https problems and all that.. but my problem now is when a user click on the app tab in my page, and their secure browsing option is disabled, they automatically redirected to the http url insted of the https. (my app can only work throu https).

I tried not putting anything in Page Tab URL: in the app settings as well as putting the https url there, but they both wont work...

how can I make my tab to default redirect to https url??

p.s. I've also tried redirecting by code like this:

if($_SERVER['HTTPS']!="on")
{
   $redirect= "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
   header("Location:$redirect");
}

and also like that:

if (!$_SERVER['HTTPS']) {
  header("HTTP/1.1 301 Moved Permanently");
  header('Location: https://[myappurl]');
  exit;
}

but it did not work

update: problem solved
I needed to fill up the app on facebook section on my application setting in facebook developer. I'm not sure why, but it worked.

解决方案

my app can only work throu https

You mean, will only "work" (in a sense of "only than can I guarantee the safety of user’s data"), or is only accessible via HTTPS?

how can I make my tab to default redirect to https url??

The user chose to browser facebook.com over HTTP, so Facebook will load the HTTP version of your app into the iframe. So unless you have at least one page of your app that is accessible via HTTP only – you can’t. If you do have such a page, redirect to the HTTPS version using JavaScript, top.location.href = "https://www.facebook.com/…"

这篇关于Facebook标签默认http通过https的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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