Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Need PHP Redirect for Affiliate Links-Please Help!
Old 09-09-2009, 10:54 PM Need PHP Redirect for Affiliate Links-Please Help!
Novice Talker

Posts: 5
Name: rick
Trades: 0
Hi Everyone and thank you for answering this post. I have a website, not a blog, where I would like to cloak/hide all my external links with a php script.

Can someone let me know of a script and also how to implement and where. I would greatly appreciate it.

Rick Saroukhanian
RICK430 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-10-2009, 03:34 PM Re: Need PHP Redirect for Affiliate Links-Please Help!
bmcoll3278's Avatar
Super Talker

Posts: 118
Name: Brian Collins
Trades: 0
This is how I do it.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>over 5000,000 movie and cd titles</title>
<meta http-equiv="REFRESH" content="0;url=your_affiliate_link _here "></HEAD>
<BODY>
</BODY></HTML>
Then I save it as index.html and create a folder for it . Something like cds

so the link would now be http://www.your_domain.com/cds

If you dont have a large amount this is quick and easy. If you have a lot I built a php script that creates the folder and the index.html file for me.
Hope this helps
__________________
I hope to build a site with something for every one

Please login or register to view this content. Registration is FREE

Last edited by bmcoll3278; 09-10-2009 at 03:35 PM..
bmcoll3278 is offline
Reply With Quote
View Public Profile Visit bmcoll3278's homepage!
 
Old 09-10-2009, 03:41 PM Re: Need PHP Redirect for Affiliate Links-Please Help!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
http://www.webmaster-talk.com/php-fo...-redirect.html
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-10-2009, 08:37 PM Re: Need PHP Redirect for Affiliate Links-Please Help!
bmcoll3278's Avatar
Super Talker

Posts: 118
Name: Brian Collins
Trades: 0
Here is a quick tutorial along with the files to do what you want.

How to cloak affiliate links
Do you have affiliate links on your site that you want to hide? It is easy to do with this little script from bmcoll.com and its free. Very easy to install. This post will guide you through it even if you know very little about php programing.

This next part is also included in the read me file that comes with the script.
Enjoy!!

how to install

1 create a folder on your server called redirect . You can use another name if you choose just

be sure to make the correct changes in the other files.

2 Open the file called .htaccess
Change the line that says ( www.bmcoll.com ) to your domain name
( catioun only change the www.bmcoll.com ) leave the rest of the line alone!!

3 open the file
index.php
You will see lines that look like this
"bmcoll"=>"http://www.bmcoll.com",

"google"=>"http://www.google.com",

"ebay"=>"http://www.ebay.com",

"wall"=>"http://www.walmart.com",

"snoops"=>"http://www.snoops.com/",

"cj"=>"http://www.cj.com/",

"yahoo"=>"http://www.yahoo.com/",

"msn"=>"http://www.msn.com/"

As long as you keep the same format you can add as many lines as you want
Here is how it works look at the first line lets break it down

"bmcoll" This is the shortcut name for the link you are cloaking.
"http://www.bmcoll.com" This is the address where you want the user to be sent

So change bmcoll to the name of your choice,And change the http://www.bmcoll.com to where you

want to send them.

Now you are ready to upload them to your server
You created a folder called redirect . Now upload both files to that folder.

Thats it. Now how to use it
Thats very simple too Lets look again at the first link ( bmcoll"=>"http://www.bmcoll.com", )

lets say you did not change that line. If you point your browser at

http://www.yourdomain.com/redirect/bmcoll.html

it would redriect you to my home page.

So basicly once you create all your shortcut names in the file you just create the link like

this

http://www.yourdomainname.com/shortcut.html

If you have further questions you can pm me

Thanks I hope this can be of use to you.


Get the zip file here
http://www.bmcoll.com/ebooks/redirect.zip


Here is the code for those who want to copy and paste

redirect.php

Code:
<?php
$goto = strtolower($_GET["name"]);

$sites = array(

"bmcoll"=>"http://www.bmcoll.com",

"google"=>"http://www.google.com",

"ebay"=>"http://www.ebay.com",

"wall"=>"http://www.walmart.com",

"snoops"=>"http://www.snoops.com/",

"cj"=>"http://www.cj.com/",

"yahoo"=>"http://www.yahoo.com/",

"msn"=>"http://www.msn.com/"


	);



header("HTTP/1.1 301 Moved Permanently");

redirect;header("Location: " . $sites[$goto]);
exit();

?>
.htaccess

Code:
Options +FollowSymLinks
RewriteEngine on


RewriteRule (.*)\.html$ http://www.bmcoll.com/redirect/index.php?name=$1
__________________
__________________
I hope to build a site with something for every one

Please login or register to view this content. Registration is FREE
bmcoll3278 is offline
Reply With Quote
View Public Profile Visit bmcoll3278's homepage!
 
Old 09-11-2009, 12:25 AM Re: Need PHP Redirect for Affiliate Links-Please Help!
Novice Talker

Posts: 5
Name: rick
Trades: 0
bmcoll3278

thank you for your reply. What do you mean in your #1 comment by stating be fure to make changes to other files when I start making my folder "redirect " for example?

So I make 1 folder called example "redirect on server and obiously and .htaccess file also within the server, right?
RICK430 is offline
Reply With Quote
View Public Profile
 
Old 09-11-2009, 12:37 AM Re: Need PHP Redirect for Affiliate Links-Please Help!
bmcoll3278's Avatar
Super Talker

Posts: 118
Name: Brian Collins
Trades: 0
if you meen this
Quote:
You can use another name if you choose just

be sure to make the correct changes in the other files
what that means is if you choose to name the folder something other than redirect then you must change the path in the .htaccess file from

redirect to whatever you name your folder.

Just look at the .htaccess file find the word redirect and change it to whatever you decide to name your folder
__________________
I hope to build a site with something for every one

Please login or register to view this content. Registration is FREE

Last edited by bmcoll3278; 09-11-2009 at 12:46 AM..
bmcoll3278 is offline
Reply With Quote
View Public Profile Visit bmcoll3278's homepage!
 
Reply     « Reply to Need PHP Redirect for Affiliate Links-Please Help!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23190 seconds with 12 queries