We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Facebook query string

Development and Programming

Sanity11's avatar
Sanity11
314 posts
13 years ago
Sanity11's avatar Sanity11

Hi All,

I’m working on a facebook app that will run throug an ee template. This works just fine exept for one problem I have: FB directs to to page through an iFrame and add a query string something like: www.site.com/facebook/app_template?code=3092084fsldhfskhdfalotofstuffhere

Ee will redirect to the 404 page when it encounters a string like that. What can I do to prevent that?

Thanks!

EDIT: Found a solution just so I can continue:

{if "{exp:ds_fb_app_helper:facebook_request test='code'}" == "FACEBOOK_REQUEST"}{embed='facebook/fb_stem_actie'}{if:else} Continue normal index template code --->

First 404 shoud go to index page. In my plugin I have a function that determines if there is a query string coming from Facebook, if it’s the case it returns true and I embed the Facebook template to the index…. not nice, but works for now.

       
Sanity11's avatar
Sanity11
314 posts
13 years ago
Sanity11's avatar Sanity11

Phew, this is giving me a headache, I think this method is responsible for emptying the session.

       
Dan Decker's avatar
Dan Decker
7,338 posts
13 years ago
Dan Decker's avatar Dan Decker

Hi Sanity11,

ExpressionEngine can behave oddly with the addition of a second query string.

You are probably aware, but EE used masked query strings to make URLs.

It’s expecting:

?code=3092084fsldhfskhdfalotofstuffhere

To be a url_title or entry_id.

There are some folks who have managed a way around this using .htaccess This example pertains to google, but a smarter person than I could mould it into a solution here:

#Catch any Google campaigns directed to the home page
RewriteCond %{REQUEST_URI} ^/index.php$
RewriteCond %{QUERY_STRING} ^(gclid=.*)
RewriteRule ^(.*)$ /index.php?/ [L,PT]

Would you like me to move this to the more appropriate Development and Programming forum?

Cheers,

       
Sanity11's avatar
Sanity11
314 posts
13 years ago
Sanity11's avatar Sanity11

Thank you Dan, I will experiment with this. The solution I eventually came up with is not something I wan’t to use again! Ah, it should be in the other forum of course, no problem!

       
nathanpitman's avatar
nathanpitman
531 posts
13 years ago
nathanpitman's avatar nathanpitman

You might want to check out this bug report too… https://support.ellislab.com/bugs/detail/14649

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.