GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   [Tech] Redirections in PHP file (https://gfy.com/showthread.php?t=1286982)

brassmonkey 12-07-2017 08:01 AM

[Tech] Redirections in PHP file
 
this is copied. i modified some of it.

I'm using this php jump script for my affiliate links.

Simply copy and paste following code to a text editor on your PC. I use Pspad

Code:

<?php
$v = $_GET['v'];
// In case someone calls naked php file
if ($v == '') {$link = 'http://pornstuffarooni.com/';}

// Add as many as links in below format. Each in a new line.
if ($v == 'fish') {$link = 'http://sexoidfsh.com/';}
if ($v == 'oils') {$link = 'http://fundepwe.com/';}
if ($v == 'grapes') {$link = 'http://grapeapewatreu.com/';}

// Don't change anything below this line.
header("Location: $link") ;
exit();
?>

i named the php file ads
ads.php and uploaded to /go/ directory, linking to following URL will redirect user to example1.com.

Code:

http://pornstuffarooni.com/go/ads.php?v=fish
Block Search Engines from Crawling and Indexing PHP files
We don't want Google to crawl these redirections. We can easily prevent it and other bots from crawling these files by blocking access to the directory. So open your robots.txt file and add following code to it.

Code:

User-agent: *
disallow: /go/*


rowan 12-07-2017 08:50 AM

I would also add a header that explicitly changes the HTTP response code to 302:

header("HTTP/1.0 302 redirect");
header("Location: $link");

rowan 12-07-2017 08:51 AM

You also have no default case. If $v isn't fish/oil/grapes then your server will tell the browser to redirect to a blank URL.

brassmonkey 12-07-2017 08:56 AM

Quote:

Originally Posted by rowan (Post 22105191)
You also have no default case. If $v isn't fish/oil/grapes then your server will tell the browser to redirect to a blank URL.

i actually use this. i have not had any issues. have sent over a million clicks this year through it

brassmonkey 12-08-2017 11:13 AM

bump for friday

brassmonkey 12-09-2017 03:43 PM

Quote:

Originally Posted by rowan (Post 22105182)
I would also add a header that explicitly changes the HTTP response code to 302:

header("HTTP/1.0 302 redirect");
header("Location: $link");

added and thank you kindly. :thumbsup


All times are GMT -7. The time now is 09:40 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc