我的域名的前缀搞乱了...我该如何解决这个问题?

问题描述:

I am writing a Facebook app and for it to work properly, I need to set the Site URL inside the Application settings. The problem is that if I set my Site URL to be

domain.com

it works on my system and a bunch of systems that I tested it on. Some of my friends complain that it is not working on their system. When I looked at what the error was, it was sending me back this:

Given URL is not allowed by the Application configuration.

which is telling me that the referrer URI that I am sending it is not what it is expecting in the Application settings. So what I did was I changed the URL to:

www.domain.com

and now my friends are able to use the application and it is failing to load on my end. Does anyone know how to fix this issue? Both cases, I tested it on Windows and Ubuntu with the same browser version yet I am seeing this problem and I don't seem to understand why this is happening.

我正在编写Facebook应用程序并且要正常工作,我需要设置站点URL 在应用程序设置中。 问题是,如果我将我的站点URL设置为 p>

domain.com code> p>

它可以在我的系统上运行 我测试过的一堆系统。 我的一些朋友抱怨它不能在他们的系统上工作。 当我查看错误是什么时,它发回给我: p>

 应用程序配置不允许给定URL。
  code>  pre>  
 
 

告诉我,我发送的引用URI不是它在应用程序设置中所期望的。 所以我做的是将URL更改为: p>

www.domain.com code> p>

现在我的朋友们都是 能够使用该应用程序,它无法加载到我的最后。 有谁知道如何解决这个问题? 这两种情况,我在Windows和Ubuntu上使用相同的浏览器版本进行了测试,但我看到了这个问题,我似乎不明白为什么会发生这种情况。 p> div>

Ok I am not a fan of this solution myself but consider this a hack... This really should be fixed on Facebook end :(

  • Step 1: In the Facebook Site-URL field of your application just put www.domain.com
  • Step 2: Create a .htaccess file in the app directory and put the following text in it:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain\.com
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent,L] 

Hope that helps someone with the same behavior.