Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 03-23-2017, 02:02 PM   #1
Cyber Fucker
Hmm
 
Cyber Fucker's Avatar
 
Industry Role:
Join Date: Sep 2005
Location: On an endless road around the world for rock and roll.
Posts: 12,642
How to preserve referrer url when redirecting with php to affiliate site

Gfy techs help!

I made a page with simple redirection, something similar to:

Code:
header("HTTP/1.1 301 Moved Permanently");
header("Location: $_SERVER['QUERY_STRING']", true, 301);
exit;
It works as intended, but I can't see the referring url in affiliate programs stats.
__________________
Cyber Fucker is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-23-2017, 02:05 PM   #2
mce
Confirmed User
 
mce's Avatar
 
Industry Role:
Join Date: Jun 2012
Location: All Over
Posts: 3,917
I'd love to see the answer too. Here's a bump for you, my man.
__________________

Pay Virtual Assistants Based on RESULTS instead of TIME
STOP getting FUCKED IN THE ASS by your VA
mce is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-23-2017, 02:29 PM   #3
Klen
 
Klen's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,234
Hmm that should do the job, could be simply how program stats are broken or they have multiple redirects which deletes original refferer so you cant do shit with it. Ask sponsor for tracking id, where you would put your refferer url.
__________________
For GFY administration inquiries- email info at gfy.com or send PM.
For advertising inquiries - email marketing at gfy.com

Inquiries which are not related to administration or advertising on GFY wont be processed.
Klen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-23-2017, 03:09 PM   #4
Cyber Fucker
Hmm
 
Cyber Fucker's Avatar
 
Industry Role:
Join Date: Sep 2005
Location: On an endless road around the world for rock and roll.
Posts: 12,642
Nah, that's not the sponsor thing I think, at least not a single case, I could be wrong though. I tested on a few. I think it's just the way php and web browsers work, same with javascript, it would not pass the referrer. But server redirection on the other hand like in htaccess would. I believe though there must be some way to trick browsers with php to pass it. Reading stackexchange at the moment, but the more I read the more mess is in my head and it's already suffering tonight from a headache. So I have thought, that perhaps someone here done it before and will save me a bit of time and struggle.
__________________
Cyber Fucker is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-23-2017, 04:01 PM   #5
Bladewire
StraightBro
 
Bladewire's Avatar
 
Industry Role:
Join Date: Aug 2003
Location: Monarch Beach, CA USA
Posts: 56,232
Code:
<?php
 
$redirect_page = "https://www.example.com/page-two.php";
 
if($_SERVER['QUERY_STRING']){
 
$query_sign = "?";
 
}else{
 
$query_sign = "";
 
}
 
header("Location: $redirect_page.$query_sign".$_SERVER['QUERY_STRING'], true, 301);
 
exit;
 
?>
__________________


Skype: CallTomNow

Bladewire is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-23-2017, 08:54 PM   #6
sarettah
l8r
 
Industry Role:
Join Date: Oct 2002
Posts: 13,440

Quote:
Originally Posted by Cyber Fucker View Post
Gfy techs help!

I made a page with simple redirection, something similar to:

Code:
header("HTTP/1.1 301 Moved Permanently");
header("Location: $_SERVER['QUERY_STRING']", true, 301);
exit;
It works as intended, but I can't see the referring url in affiliate programs stats.
Easiest way I know is to do a HTML Meta refresh. The referer gets passed that way.

Code:
<meta http-equiv="refresh" content="0; url=page_to_go_too">
So, if you are doing it via php, something like this:

Code:
<html>
<head>
<meta http-equiv="refresh" content="0; url=<?php echo $_SERVER['QUERY_STRING']; ?>"> 
</head>
<body>
</body>
</html>
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-23-2017, 09:38 PM   #7
Bladewire
StraightBro
 
Bladewire's Avatar
 
Industry Role:
Join Date: Aug 2003
Location: Monarch Beach, CA USA
Posts: 56,232
Quote:
Originally Posted by sarettah View Post

Code:
<html>
<head>
<meta http-equiv="refresh" content="0; url=<?php echo $_SERVER['QUERY_STRING']; ?>"> 
</head>
<body>
</body>
</html>



__________________


Skype: CallTomNow

Bladewire is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-24-2017, 04:54 AM   #8
Paz
Confirmed User
 
Paz's Avatar
 
Industry Role:
Join Date: Jun 2012
Posts: 457
Quote:
Originally Posted by Cyber Fucker View Post
It works as intended, but I can't see the referring url in affiliate programs stats.
Some good suggestions already, also if you are redirecting from https to http you won't pass the referrer plus some browser settings and devices don't pass referrer as well.
Paz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-24-2017, 06:06 AM   #9
freecartoonporn
Confirmed User
 
freecartoonporn's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: NC
Posts: 7,681
Quote:
Originally Posted by Bladewire View Post



freecartoonporn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-24-2017, 07:48 AM   #10
sarettah
l8r
 
Industry Role:
Join Date: Oct 2002
Posts: 13,440
Quote:
Originally Posted by Bladewire View Post



Quote:
Originally Posted by freecartoonporn View Post


Is there a problem with my solution? Or am I mis-interpreting something?

Proof of concept:

http://www.hatterasdesigns.com/testr...test_redir.php

Code:
<html>
<head>
<meta http-equiv="refresh" content="0; url=<?php echo $_SERVER['QUERY_STRING']; ?>"> 
</head>
<body>
</body>
</html>

The madspiders.com page simply echoes the referer

Code:
<?php
echo "referer is " . $_SERVER['HTTP_REFERER'];
?>
.
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-24-2017, 07:55 AM   #11
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,883
you are supposed to do the opposite (hide the referer), so the sponsor doesn't steal your traffic sources/methods/etc...
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-24-2017, 08:00 AM   #12
Cyber Fucker
Hmm
 
Cyber Fucker's Avatar
 
Industry Role:
Join Date: Sep 2005
Location: On an endless road around the world for rock and roll.
Posts: 12,642
Quote:
Originally Posted by woj View Post
you are supposed to do the opposite (hide the referer), so the sponsor doesn't steal your traffic sources/methods/etc...
Maybe you are right. I was thinking about it. All in all I got details on my end in my own logs (that was the whole purpose of this redirection page, so that programs don't cheat me on the actual numbers) and also there are campaign tools in most programs that can shed some light on the question where the traffic comes from. So yeah, maybe you are right.
__________________
Cyber Fucker is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-24-2017, 02:39 PM   #13
Bladewire
StraightBro
 
Bladewire's Avatar
 
Industry Role:
Join Date: Aug 2003
Location: Monarch Beach, CA USA
Posts: 56,232
Quote:
Originally Posted by sarettah View Post
Is there a problem with my solution? Or am I mis-interpreting something?
I was complimenting you on the clean code Sarettah! Line 3 specifically




Bladewire is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-24-2017, 03:16 PM   #14
shake
frc
 
Industry Role:
Join Date: Jul 2003
Location: Bitcoin wallet
Posts: 4,663
Quote:
Originally Posted by woj View Post
you are supposed to do the opposite (hide the referer), so the sponsor doesn't steal your traffic sources/methods/etc...
I used to always re-direct through a fake tgp to show sponsors a legit looking referer.
__________________
Crazy fast VPS for $10 a month. Try with $20 free credit
shake is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-24-2017, 04:52 PM   #15
sarettah
l8r
 
Industry Role:
Join Date: Oct 2002
Posts: 13,440
Quote:
Originally Posted by Bladewire View Post
I was complimenting you on the clean code Sarettah! Line 3 specifically
Ok, I wasn't sure how to take it. Sorry about that.

.
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-24-2017, 10:21 PM   #16
freecartoonporn
Confirmed User
 
freecartoonporn's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: NC
Posts: 7,681
Quote:
Originally Posted by sarettah View Post
Is there a problem with my solution? Or am I mis-interpreting something?
i about the GIF.
freecartoonporn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
affiliate, helpme, url, permanently;, headerlocation, true, 301;, $_server[query_string], exit;, programs, stats, referring, moved, intended, site, gfy, techs, php, redirecting, preserve, referrer, similar, headerhttp/1.1, redirection, simple
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.