• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to put a file in controller or view but have it render as a fully pathed URL?

I am working on a Facebook connect integration with CodeIgniter. I have everything working, but just not exactly the way I want it.

Here's the problem:

I want my callback URL in my Facebook Connect app to be http://mydomain.com/callbackdir/

The facebook connect relies on a file called xc_receiver.htm to deal with cross-domain authentication issues. Because of the way things are configured, Facebook wants to see this file at:


I have my controllers set up with home.php as the default and divided into subdirectories for cleanliness like so:


Is there any way for me to put my xd_receiver.htm file somewhere and have it look like it's under the directory of my controller, callbackdir?

I have everything working fine if I leave FB connect stuff at root. I can leave it there if this is not possible, I just would rather organize things as noted above. Thanks!

I know squat about Facebook apps but it sounds like you can do a rewrite in your .htaccess file; e.g.:

RewriteEngine on
RewriteRule ^callbackdir/xd_receiver.htm$ /home.php/callbackdir/xd_reveiver [L]

Ah, of course! That is a very simple solution. So, here's what it looks like:

In my .htaccess file, I have:

RewriteEngine on
RewriteRule ^fbconnect/xd_receiver.htm$ /fbconnect/home/xd_receiver [L]

In my fbconnect/home.php controller, I have:
function xd_receiver(){

So far, so good. Thanks for your help!

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.