ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Handling ?ref=“nf”

January 10, 2011 9:41am

Subscribe [5]
  • #1 / Jan 10, 2011 9:41am

    Gnuus

    96 posts

    I have a question, facebook is appending ?ref=nf to my links and it’s breaking my links:

    e.g. http://domain.com/someUniqueID?ref=nf

    Any thoughts on a graceful way to strip that out?

  • #2 / Jan 10, 2011 3:35pm

    Brandon Jones

    5500 posts

    Hi Gnuus,

    1. Which version and build are you using?
    2. In your system/expressionengine/config.php file what is set for $config[‘uri_protocol’]?

    This may be a job for URL rewrite rules on your server, but let’s start with the above.

  • #3 / Jan 11, 2011 2:59am

    Gnuus

    96 posts

    I.m on v2.1.3 Build:  20101220

    $config['uri_protocol'] = "AUTO";
  • #4 / Jan 11, 2011 3:08am

    Gnuus

    96 posts

    I got the suggestion from someone on the CodeIgniter forum to put this in the index.php

    if( stristr( $_SERVER['REQUEST_URI'], '?ref=nf' ) ) {
            header( "location: http://" . $_SERVER['HTTP_HOST'] . str_replace( '?ref=nf', '', $_SERVER['REQUEST_URI'] ) );
            exit;
        }

    ...but it didn’t work for me.

  • #5 / Jan 11, 2011 4:45am

    Gnuus

    96 posts

    Hi Gnuus,


    In your system/expressionengine/config.php file what is set for $config[‘uri_protocol’]?

    I changed the config from auto to path_info, but now it’s not displaying the right page!?

    $config['uri_protocol'] = "PATH_INFO";
  • #6 / Jan 11, 2011 3:59pm

    Ingmar

    29245 posts

    Please don’t change anything for now. What error or other message are you getting? Do you’ve got a link you can share with us?

  • #7 / Jan 12, 2011 2:40am

    Gnuus

    96 posts

    Here is a link:

    Example

    After clicking you get an Error 404 page.

  • #8 / Jan 12, 2011 3:42pm

    Ingmar

    29245 posts

    Have you changed anything? http://afpunt.nl/?/AF/comments/remco_campert seem to be working fine. I just got the page correctly (I assume, talking about the “dichter en schrijver Remco Campert”).

  • #9 / Jan 13, 2011 3:04am

    Gnuus

    96 posts

    That’ strange, because click this on Facebook you get an error, but when you click the link here it’s allright!?

    http://www.facebook.com/l.php?u=http://afpunt.nl/?/AF/comments/remco_campert&ref=nf&h=0a5c8

  • #10 / Jan 13, 2011 3:37pm

    Ingmar

    29245 posts

    What error are you getting? If it’s a 404, can you show us the exact URL that led there?

  • #11 / Jan 14, 2011 2:22am

    Gnuus

    96 posts

    As I mentioned before, it’s a 404 page.

    When you go to http://www.facebook.com/AFpunt and you click on any of the images in the posts, you get the 404 error page.

  • #12 / Jan 14, 2011 9:47am

    Ingmar

    29245 posts

    Looks like I have no permission to view this page, unfortunately.

  • #13 / Jan 14, 2011 10:03am

    Gnuus

    96 posts

    Yes, of course, on Facebook you have to become my friend first!

  • #14 / Jan 14, 2011 4:59pm

    Sue Crocker

    26054 posts

    I don’t see anywhere to become your friend on Facebook. I tried. 😊 However troubleshooting Facebook links is sort of beyond the scope of this forum..

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases