Get exclusive CAP network offers from top brands

View CAP Offers

redirect affiliate links

darko asked 4 years ago
Hi. Can anyone tell me how to make the redirect links? I want to hide them like http://www.website.com/site to redirect to site.com/aff… I was thinking about .htaccess but can’t find anywhere on the net how to set it up…any help please?
5 Answers
casinotime answered 4 years ago
Hi Darko,

Visit this site http://www.stevedawson.com/article0006.php

the php script works very well <span title=” title=”” class=”bbcode_smiley” /> and can be used on an html site too.

darko answered 4 years ago
hah this script is so easy to work with… thanks casinotime you saved my life :hattip: so much easier than the .htaccess bul****

smartface answered 4 years ago
the script describes the main things and is very easy to use. But it wastes resources and may cause some error messages.
There are special cases not handled. What if you misspelled some client you want to link to. So you have to handle the case that no if query is successful.

A better one would be

if( …..){
header( ‘Location: link’);
exit;
} elseif (…..){
header( ‘Location: link’);
exit;
} else{
header( ‘Location: link’);
exit;
}

The else case will be used if no other query succeeds. This is neccessary as users may looking for weak points in your scripts and may change the URLs.
The elseif queries are much better as only one case can be successful. In the told script all queries are checked not relevant if the first one is successful already. Also it is not neccessary to store the link in a variable. It is much better to redirect directly and stop the script.

casinotime answered 4 years ago
Interesting but slightly confused…

Using the original script i have not had issues.

Changing the url to seek a nonexistant link loads the index page. which is fine by me.

There is no reason for a person to seek a weak link in a redirect script… no value in doing it just wasting their own time.?

smartface answered 4 years ago
It’s possible that your server doesn’t show error messages and links in this case to the index page. But this is not a default behaviour.

I didn’t say that the script is not working and it might be unimportant if the links are not stored in a database, but it’s not the really good solution.