Go Back   Free website templates > Web Template Help > PHP and MySQL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Join now to download all the free website templates or post on the forum. If you have never been on a forum before read the FAQ. It's quick, easy and free to join!
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-10-2009, 11:33 PM
bmcoll3278's Avatar
Moderator
 
Join Date: Jun 2009
Posts: 294
bmcoll3278 is on a distinguished road
Default how to hide affiliate links

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 contact me at admin@bmcoll.com

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 body
www.bmcoll.com

Last edited by bmcoll3278; 09-11-2009 at 09:07 PM.
Reply With Quote
  #2 (permalink)  
Old 09-16-2009, 02:03 PM
ishkey's Avatar
Moderator
 
Join Date: Aug 2007
Location: North GA USA
Posts: 1,360
ishkey will become famous soon enough
Default

a viable solution to mask those long link names which look like you are being scammed (avg viewer) I don't subscribe to the links being hijacked and lost revenue theory.

I do believe to be safe you need to put redirect.php into it's own password protected directory and set your .htaccess file as to not allowing viewing or indexing if you do not want be penalized by all the search engines.
If you think about it you could do away with the php file and just load it up into the .htaccess file using wildcards
Quote:
RewriteEngine On
RewriteRule go/(.*)/$ /go/index.php?title=$1 [L]
or specify each one
Quote:
RewriteEngine On
RewriteRule go/bmcoll/$ http://www.www.bmcoll.com/affiliates.php?id=2039 [L]
RewriteRule go/snoops/$ http://www.snoops.com/?id=343932 [L]
RewriteRule go/google/$ http://www.www.google.com/refer.php?pub=10943 [L]
I would also be concerned with some sorta of counting included in the script to see the click through rate.
__________________
RIF= Reading Is Fun - Understanding Funner
cleandeck - lawn mower undercoating and wilmargraphite - graphite lubricants
Reply With Quote
  #3 (permalink)  
Old 09-17-2009, 03:43 AM
bmcoll3278's Avatar
Moderator
 
Join Date: Jun 2009
Posts: 294
bmcoll3278 is on a distinguished road
Default

It is a basic script. I stuck to php for 2 reasons
1 I dont know much about modrewrite yet
2 the average guy looking for a solution on line will feel more comfortable with php.

I dont believe the links high jacked either.
But making the links search engine friendly is the goal behind the script.
Thanks Dave for the input.
When I have some spare time I will try to add to the script so it counts hits But if I do I do not like flat data bases so it will be with sql.

A question for you dave. Can a .htaccess file be written with php fopen or file write?

I have no idea I have never tried it. Maybe I will try it.
__________________
I hope to build a site with something for every body
www.bmcoll.com
Reply With Quote
  #4 (permalink)  
Old 09-17-2009, 10:59 AM
ishkey's Avatar
Moderator
 
Join Date: Aug 2007
Location: North GA USA
Posts: 1,360
ishkey will become famous soon enough
Default

Quote:
A question for you dave. Can a .htaccess file be written with php fopen or file write?
no - you are talking directly with the server in it's own language.
it's like you have the master key to get in, set things up to run the way you want to and leave. if you could use another language to set the server, it would open you up to attacks.
you set up your data base in it's language - you can talk to it to get info in php, but can not change the structure of it.
__________________
RIF= Reading Is Fun - Understanding Funner
cleandeck - lawn mower undercoating and wilmargraphite - graphite lubricants
Reply With Quote
  #5 (permalink)  
Old 09-19-2009, 07:59 PM
bmcoll3278's Avatar
Moderator
 
Join Date: Jun 2009
Posts: 294
bmcoll3278 is on a distinguished road
Default

ok Thanks again. By the way the pm from you and covertpea, I sent a reply.

I would be glad to help any way I can.
__________________
I hope to build a site with something for every body
www.bmcoll.com
Reply With Quote
  #6 (permalink)  
Old 09-19-2009, 08:17 PM
ishkey's Avatar
Moderator
 
Join Date: Aug 2007
Location: North GA USA
Posts: 1,360
ishkey will become famous soon enough
Default

Ok by the way your contact admin is not uploading . it's returning a error page.
__________________
RIF= Reading Is Fun - Understanding Funner
cleandeck - lawn mower undercoating and wilmargraphite - graphite lubricants
Reply With Quote
  #7 (permalink)  
Old 09-19-2009, 11:43 PM
bmcoll3278's Avatar
Moderator
 
Join Date: Jun 2009
Posts: 294
bmcoll3278 is on a distinguished road
Default

Thanks I forgot I deleted the thankyou page. I fixed it . it just send you back to the main page now.

Did you see I got the html repair script to output a numbered list like you asked.
__________________
I hope to build a site with something for every body
www.bmcoll.com
Reply With Quote
  #8 (permalink)  
Old 10-08-2009, 04:49 AM
Junior Member
 
Join Date: Oct 2009
Posts: 6
togu25 is on a distinguished road
Default

I will download and try it

Last edited by CovertPea; 10-08-2009 at 01:29 PM.
Reply With Quote
  #9 (permalink)  
Old 10-08-2009, 05:47 AM
bmcoll3278's Avatar
Moderator
 
Join Date: Jun 2009
Posts: 294
bmcoll3278 is on a distinguished road
Default

Quote:
Originally Posted by togu25 View Post
I will download and try it
let me know if you have questions
__________________
I hope to build a site with something for every body
www.bmcoll.com
Reply With Quote
  #10 (permalink)  
Old 10-11-2009, 06:44 PM
vareside's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 254
vareside is on a distinguished road
Default

How about simply using ordinary URL Shorteners like:
Shorten your URL with anything
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:02 PM.



mouseover mouseover mouseover