title: The redirect_uri URL must be absolute Facebook login PHP SDK
body: <p>I am trying to implement the facebook login in my project in codeigniter.</p>
  
  <p>I am using the php sdk.</p>
  
  <p>When I click on the login button, it gives me an error:</p>
  
  <pre><code>The redirect_uri URL must be absolute
  </code></pre>
  
  <p>What is the problem and how do I fix it?</p>
  
  <p>Here is the contents of <code>view/home.php</code>:</p>
  
  <pre><code> &lt;?php if(!$fb_data['me']): ?&gt;
    Please login with your FB account: 
    &lt;a href="&lt;?php echo $fb_data['loginUrl']; ?&gt;"&gt;login&lt;/a&gt;
    &lt;?php else: ?&gt;
    &lt;img src="https://graph.facebook.com/&lt;?php 
      echo $fb_data['uid']; ?&gt;/picture" alt="" class="pic" /&gt;
    &lt;p&gt;Hi &lt;?php echo $fb_data['me']['name']; ?&gt;,&lt;br /&gt;
      &lt;a href="&lt;?php 
      echo site_url('welcome/topsecret'); ?&gt;"&gt;
      You can access the top secret page&lt;/a&gt; or 
      &lt;a href="&lt;?php echo $fb_data['logoutUrl']; ?&gt;"&gt;logout&lt;/a&gt; &lt;/p&gt;
    &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>Here is the contents of: <code>controler/home.php</code></p>
  
  <p>
  
  <pre><code>class Home extends CI_Controller {
  
     function __construct()
      {
          parent::__construct();
  
          $this-&gt;load-&gt;model('Facebook_model');
      }
  
      function index(){
          $this-&gt;load-&gt;model("Concertos_model");
          $data['banners'] = $this-&gt;Concertos_model-&gt;get_banner_data();
  
  
         $fb_data = $this-&gt;session-&gt;userdata('fb_data'); // This array contains all the user FB information
  
          $data = array(
                      'fb_data' =&gt; $fb_data,
                      );
  
          $this-&gt;load-&gt;view('home', $data);   
  
      }
  
      function topsecret()
      {
          $fb_data = $this-&gt;session-&gt;userdata('fb_data');
  
          if((!$fb_data['uid']) or (!$fb_data['me']))
          {
              redirect('home');
          }
          else
          {
              $data = array(
                          'fb_data' =&gt; $fb_data,
                          );
  
              $this-&gt;load-&gt;view('home', $data);
          }
      }
  
  }
  </code></pre>
  
  <p>Contents of: <code>model/Facebook_model.php</code>:</p>
  
  <pre><code>&lt;?php
  class Facebook_model extends CI_Model {
  
      public function __construct()
      {
          parent::__construct();
  
          $config = array(
                          'appId'  =&gt; 'xxxxxxxxxxxxxxxxxxx',
                          'secret' =&gt; 'xxxxxxxxxxxxxxxxxxxxxxxxx',
                          'fileUpload' =&gt; true, // Indicates if the CURL based @ syntax for file uploads is enabled.
                          );
  
          $this-&gt;load-&gt;library('Facebook', $config);
  
          $user = $this-&gt;facebook-&gt;getUser();
  
          // We may or may not have this data based on whether the user is logged in.
          //
          // If we have a $user id here, it means we know the user is logged into
          // Facebook, but we don't know if the access token is valid. An access
          // token is invalid if the user logged out of Facebook.
          $profile = null;
          if($user)
          {
              try {
                  // Proceed knowing you have a logged in user who's authenticated.
                  $profile = $this-&gt;facebook-&gt;api('/me?fields=id,name,link,email');
              } catch (FacebookApiException $e) {
                  error_log($e);
                  $user = null;
              }
          }
  
          $fb_data = array(
                          'me' =&gt; $profile,
                          'uid' =&gt; $user,
                          'loginUrl' =&gt; $this-&gt;facebook-&gt;getLoginUrl(
                              array(
                                  'scope' =&gt; 'email,user_birthday,publish_stream', // app permissions
                                  'redirect_uri' =&gt; 'home' // URL where you want to redirect your users after a successful login
                              )
                          ),
                          'logoutUrl' =&gt; $this-&gt;facebook-&gt;getLogoutUrl(),
                      );
  
          $this-&gt;session-&gt;set_userdata('fb_data', $fb_data);
      }
  }
  </code></pre>
  
  <p>Why does facebook return that message and how do I fix it?</p>