Welcome Guest, Not a member yet? Register   Sign In
Handling ?ref="nf" gracefully
#1

[eluser]msteudel[/eluser]
So I had 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?

One thought is to add some in the index.php bootstrap, but it'd be cool to be able to use routes ...

Thanks, Mark
#2

[eluser]Gnuus[/eluser]
[quote author="msteudel" date="1288995462"]So I had 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?

One thought is to add some in the index.php bootstrap, but it'd be cool to be able to use routes ...

Thanks, Mark[/quote]


I would like to know this too, any ideas??
#3

[eluser]Gnuus[/eluser]
Nobody?
#4

[eluser]Victor Michnowicz[/eluser]
It sounds like some .htaccess may do the trick. Maybe this can help: http://dranger.com/weblog/entry/apache_m...tring.html
#5

[eluser]Ochetski[/eluser]
A regular expression replacing all after ? should help.

Something like this on the htaccess file may do the trick:

Code:
Options +FollowSymlinks
RewriteEngine on

RewriteRule ^(.*)\?.*$ $1 [R]
#6

[eluser]Gnuus[/eluser]
Does not work for me, thanks anyway!
#7

[eluser]msteudel[/eluser]
I ended putting this in my index.php file:
Code:
if( stristr( $_SERVER['REQUEST_URI'], '?ref=nf' ) ) {
        header( "location: http://" . $_SERVER['HTTP_HOST'] . str_replace( '?ref=nf', '', $_SERVER['REQUEST_URI'] ) );
        exit;
    }
#8

[eluser]Gnuus[/eluser]
Thanks, but didn't work for me.

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

Code:
$config['uri_protocol'] = "PATH_INFO";




Theme © iAndrew 2016 - Forum software by © MyBB