41374

Facebook API site URL

Question:

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?

Answer1:

There are two approaches:

<ol><li>Redirect all the traffics from www to non-www in .htaccess</li> <li>Add the www domain to App Domains, in facebook app settings.</li> </ol>

See more: <a href="https://stackoverflow.com/questions/12050590/redirect-non-www-to-www-in-htaccess" rel="nofollow">Redirect non-www to www in .htaccess</a>, <a href="https://stackoverflow.com/questions/8574344/what-are-app-domains-in-facebook-apps" rel="nofollow">What are App Domains in Facebook Apps?</a>

Recommend

  • Excluding one category in Wordpress
  • Escaping backslashes in method call stringByReplacingOccurrencesOfString Does not work in Objective
  • Regular expression to get the main domain of a URL
  • Angular Html5Mode PlayFramework gives 404 when refreshed
  • Switch-AzureRmWebAppSlot no longer supports Production slot name
  • CakePHP 2 How to pass variables through the URL when using pagination?
  • XPath evaluate a query and retrieve the value
  • Safari blurs strange bugs
  • Shortest path in a grid
  • What products support 3-digit region subtags, e.g., es-419 for Latin-American Spanish?
  • Process.StartTime Access Denied
  • Giving security priviliege to a scheduler in Java EE 6
  • XMPPConnection Error in android
  • How to Update model and database with code first approach in Asp.net MVC
  • Should I optimize around reads or CPU time in Google App Engine
  • Command line installation of Code Signing certificates, .p12 files, and mobileprovisions
  • Eclipse MTJ doesn't see Java ME SDK 3.0 devices
  • rspec simple example getting error on request variable in integration test
  • ADO and msqli connections very slow
  • How to attach a node.js readable stream to a Sendgrid email?
  • Scrapy recursive link crawler
  • req.body is undefined - nodejs
  • Optimizing database types to compact database (SQLite)
  • Cross-Platform Protobuf Serialization
  • Symfony2: How to get request parameter
  • Hazelcast - OperationTimeoutException
  • Do I've to free mysql result after storing it?
  • Akka Routing: Reply's send to router ends up as dead letters
  • RestKit - RKRequestDelegate does not exist
  • Circular dependency while pushing http interceptor
  • Is there a mandatory requirement to switch app.yaml?
  • Revoking OAuth Access Token Results in 404 Not Found
  • AngularJs get employee from factory
  • How to set the response of a form post action to a iframe source?
  • Change div Background jquery
  • Turn off referential integrity in Derby? is it possible?
  • Authorize attributes not working in MVC 4
  • Busy indicator not showing up in wpf window [duplicate]
  • Python/Django TangoWithDjango Models and Databases
  • Net Present Value in Excel for Grouped Recurring CF