Facebook API网站网址
问题描述:
我的网站的用户管理完全通过facebook登录完成.而且我已经在Facebook应用程序中将站点URL指定为sitename.com
.但是,当以www
infront作为www.sitename.com
来访问该站点时,facebook API无法正常工作.但是,如果我将Facebook应用程序中的站点URL更改为www.sitename.com
,则可以正常运行.有办法解决吗?
My website's user management is totally done via facebook login. And I've specified the site URL as sitename.com
inside the Facebook app. However, when the site is visited with www
infront as www.sitename.com
, the facebook API fails to work. But if I change the site URL inside the Facebook app to www.sitename.com
, it works perfectly. Is there a way to solve this?
答
有两种方法:
- 将所有流量从.htaccess中的
www
重定向到non-www
- 在Facebook应用程序设置中将
www
域添加到App Domains
.
- Redirect all the traffics from
www
tonon-www
in .htaccess - Add the
www
domain toApp Domains
, in facebook app settings.