Note that there are some explanatory texts on larger screens.

plurals
  1. PORewrite URL crashes facebook sdk for php
    primarykey
    data
    text
    <p>I have this scenario. On a MVC web app we are rewriting the url:</p> <pre><code>RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.+)$ index.php?url=$1 [QSA,L] </code></pre> <p>So the url might be:</p> <pre><code>http://mysite.com/ControllerName/MethodName/Param1/Param2....... </code></pre> <p>Now we need to implement a facebook login on the app. We simply copy and paste the code from the sdk page on git</p> <pre><code>require 'facebook-php-sdk/src/facebook.php'; $facebook = new Facebook(array( 'appId' =&gt; 'YOUR_APP_ID', 'secret' =&gt; 'YOUR_APP_SECRET', )); // Get User ID $user = $facebook-&gt;getUser(); if ($user) { try { // Proceed knowing you have a logged in user who's authenticated. $user_profile = $facebook-&gt;api('/me'); } catch (FacebookApiException $e) { error_log($e); $user = null; } } if ($user) { $logoutUrl = $facebook-&gt;getLogoutUrl(); } else { $loginUrl = $facebook-&gt;getLoginUrl(); } </code></pre> <p>Done this, the <code>$user</code> is always 0, because facebook returns to the 'redirect_uri' with <code>?key=parm</code> where the user information is located.</p> <p>The actual URL redirected to by Facebook look like:</p> <pre><code>http://localhost/tesis/?state=6713ce83f25b296abd372ccad20a244d&amp;code=AQA6xxwPiiQt06luKaDD84dFxIXPuhO41RlCQcnV5K2ZtVjyKvZ3A7uqqOQlEX4To_CoT8nEmUjzS2YOVsdhU5CE3I_jfK2LsmkpLsty91-EeipIIvFQLqe6VFB_OHYcj_J0-jdhXfAdYFQ2jsA6Hejnw8bF1ezWtEaZCNnqgc_mQWhovkV8XmFzLFGsqjr52bq2b0wR8Au3ZOSvJUnperaT#_=_ </code></pre> <p>So I suppose I need to make some modifications on the htaccess. But I don't know what changes I need to do</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload