View Full Version : Using php redirects for sponsor links
Beenie
2006-11-29, 12:45 PM
I wanted to setup some php redirects for sponsor links but can't seem to get it working. Can anyone lend me a hand?
I've put this in a .php file
<?php header(’Location: http://www.link.com/') ; ?>
But when I hit the link nothing happends and I just see a blank page.
What am I doing wrong or is there another way to do this?
This ofcourse will not track anything but just function as a simple redirect. Are there any scripts out there that can actually track hits but still make links like domain.com/go/paysitename.php ?
Any help will be appreciated.
tickler
2006-11-29, 03:49 PM
I generally load the link(random) to a variable first.
<?
$GOTO_URL = "http://www.link.com/";
header("Location: ".$GOTO_URL);
?>
</HTML></BODY>
I wanted to setup some php redirects for sponsor links but can't seem to get it working. Can anyone lend me a hand?
I've put this in a .php file
<?php header(’Location: http://www.link.com/') ; ?>
But when I hit the link nothing happends and I just see a blank page.
What am I doing wrong or is there another way to do this?
This ofcourse will not track anything but just function as a simple redirect. Are there any scripts out there that can actually track hits but still make links like domain.com/go/paysitename.php ?
Any help will be appreciated.It all looks OK, except the symbol before the 'Location' is not the same as that at the end.
Should be either an apostrophe ( ' ) or a quotation mark ( " ), just as long as they are the same.
As far as scripts go, you can do what you are already doing or use .htaccess:
Assuming you own the site 'http://www.yoursite.com/'
If you want to link to 'Paysite Name', create a link on your site to point to http://www.yoursite.com/paysitename/
Utilising your current method would be to make a folder called 'paysitename'.
In the folder you would put an 'index.php' file with the following single line
<?php header('Location:http://www.paysite.com/trackingurl.html');?>
To use .htaccess, add the following line to your .htaccess file
RewriteRule ^paysitename/? http://www.paysite.com/trackingurl.html [L,R]You can put as many of these in your .htaccess as you like, just as long as they are unique.
HTH
~Steve
vBulletin® v3.8.1, Copyright ©2000-2026, Jelsoft Enterprises Ltd.