views:

26

answers:

1

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.

+2  A: 

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.

Legend