Welcome to WebmasterWorld Guest from 54.144.107.83

Forum Moderators: open

Message Too Old, No Replies

Cloaking URL using 2 different methods

Framed or UN-Framed affiliate URL?

     
11:33 am on Jun 3, 2009 (gmt 0)

New User

5+ Year Member

joined:July 22, 2007
posts: 40
votes: 0


I was trying to cloak my affiliate URL and I found 2 ways to cloak it.
The first method is a FRAMED html method (URL staying within your own domain).
The second method is a NON-FRAMED php cloaking method (Directly redirecting URL to affilate page) .

First example : [test.example.com...]

Second example : [test.example.com...]

Please click on the links above, and you will get what I meant.

May I know :
1) Which is a better way to cloak my affiliate link and serve better protection for affiliate link theft?
2) Which method is proven to be having a higher conversion rate and thus serve as a better way to maximize my earning as an affiliate ?

Thanks in advance for any suggestion made.

P/S : You can take a view at the source code of the FRAMED URL if you would like to, and let me know if that is vulnerable to any kind of risk..

[edited by: incrediBILL at 2:38 pm (utc) on June 3, 2009]
[edit reason] exemplified URLs [/edit]

10:07 am on June 4, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Apr 30, 2007
posts:1394
votes: 0


you should structure the urls subject to the visitor's request. Taking into account things like the ip, date, time, http headers with the link you present to the visitor with some custom encoding can eliminate chances of abuse.

Another way is using some sort of handshaking between 2 servers that is completely transparent to visitors. For instance if instead of a link I use a form with a post method, then the servers can communicate first and finally redirect headers are issued to the visitor.

Disadvantages with these approaches is that both ends need to have the encoding/decoding methods deployed, something hard to do unless you are really popular or you're the owner of both ends in some way.

1:45 pm on June 4, 2009 (gmt 0)

New User

5+ Year Member

joined:July 22, 2007
posts: 40
votes: 0


Wow thanks enigma1, never know there are such things exist..

But probably this is not the kind of cloaking that I was mentioning. Probably what I was trying to say is URL redirecting here. What I am trying to do, is just to cloak a product's affiliate link, say a ClickBank product.

The original affiliate link could be something like :
[myClickBankID.merchantA.example.net...]

and I am trying to cloak it using my website's URL , say :
http://www.example.com/recommends/merchantA/ [google.com] ... When people click on my link, they will be redirect to [myClickBankID.merchantA.example.net...] .

Also, I am trying to do it with the 2 methods (framed and unframed) above.

Between the two methods which I have posted in my initial post, which would be a better method ? Any suggestion please?

8:41 am on June 5, 2009 (gmt 0)

New User

5+ Year Member

joined:July 22, 2007
posts:40
votes: 0


Well, after some study on this case, I think I would go for the PHP Redirect method. It seems to be working just fine.

Anyway, thanks for your input given here.

10:27 am on June 5, 2009 (gmt 0)

New User

5+ Year Member

joined:July 22, 2007
posts: 40
votes: 0


But even if I were to use the php redirection method, there are two codes that I came across.

<?php
header('Location: h-t-tp://www.YourAffiliateURLHere.com/');
?>

AND

<?php
$url =
"YourFullAffiliateURL";
header("Location: $url");
exit();
?>

Can anyone please tell me what's the difference between the two codes?

11:29 am on June 5, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Apr 30, 2007
posts:1394
votes: 0


The difference is the first method won't work well while the 2nd does. Not because the var assignment but of the exit command. The header alone doesn't guarantee the redirect ot be immediate unless it is the end of the script. While the 2nd does exits specifically so anything below that won't be executed.

btw the 2nd method with the $url var it should include the full url.

$url = 'http://www.example.com';

1:52 pm on June 5, 2009 (gmt 0)

New User

5+ Year Member

joined:July 22, 2007
posts: 40
votes: 0


Wow thanks enigma1, that helps a lot !
So that means, if I am going to use the 2nd code, it would be something like this :

<?php
$url =
"http://www.example.com/recommends/affiliate1234/";
header("Location: $url = 'http://www.example.com/recommends/affiliate1234/'");
exit();
?>

Is that the correct way to do so ? I am sorry, but I am not a programming guy here, and I know nothing about php language.

Thanks in advance for your input :)

4:53 pm on June 5, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Apr 30, 2007
posts:1394
votes: 0


Just use the $url in the header since you have the variable already.
<?php
$url =
"http://www.example.com/recommends/affiliate1234/";
header("Location: " . $url);
exit();
?>
4:33 am on June 6, 2009 (gmt 0)

New User

5+ Year Member

joined:July 22, 2007
posts:40
votes: 0


I got it. Thank you very much enigma1 :) It helps a lot
4:47 am on June 6, 2009 (gmt 0)

New User

5+ Year Member

joined:July 22, 2007
posts: 40
votes: 0


I noticed a small difference between the code I found and the code which you've provided, enigma1, I have tried both, and they both worked.

Note the difference in the bolded area part.

<?php
$url =
"YourFullAffiliateURL";
header("Location: $url");
exit();
?>

============================================================

<?php
$url =
"YourFullAffiliateURL";
header("Location: " . $url);
exit();
?>

So it's ok if I am going to use your code, right ?

10:13 am on June 6, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Apr 30, 2007
posts:1394
votes: 0


yes sure it should be fine. It's just when I use php vars I set them up outside string quotes to avoid problems with single quotes that sometimes you may forget and use.
12:38 pm on June 6, 2009 (gmt 0)

New User

5+ Year Member

joined:July 22, 2007
posts:40
votes: 0


Alright thanks a lot. Off to set the code into my server now.

Have a nice day

8:34 am on June 7, 2009 (gmt 0)

New User

5+ Year Member

joined:July 22, 2007
posts: 40
votes: 0


Hi enigma1, it's me again.

ClickBank has their own encryption page, but after clicking on the link, and landed on the affiliate product's page, it will still show my affiliate name (?hop=ClickbankUsername), for example..
http://example.com/?hop=ClickbankUsername

Is there anyway that I can hide the (?hop=ClickbankUsername), using any php script ?

Thanks in advance

[edited by: incrediBILL at 11:35 am (utc) on June 19, 2009]
[edit reason] exemplified URLs [/edit]

9:03 am on June 7, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Apr 30, 2007
posts:1394
votes: 0


You can hide it if the protocol supports passing the info via the /POST parameters. So instead of having links you setup a form (that looks like a link) which will pass the parameters to the server once the client clicks the link.

<form name="some_form_name" action="http://www.example.com/some_link.htm" method="post"><input type="hidden" name="hop" value="ClickbankUsername" /><input type="submit" name="some_button" value="link to click" /></form>

As I mentioned earlier depends on the protocol that is in place. If you need to pass parameters by other means or to communicate with another server see the curl library and the fsockopen function for this.

[php.net...]
[php.net...]

5:29 pm on June 7, 2009 (gmt 0)

New User

5+ Year Member

joined:July 22, 2007
posts:40
votes: 0


Wow, again, thanks for that . It sounded too technical for me, but never mind, I will further dig into those related information on which you've given me.

Thanks a lot.

6:23 am on June 19, 2009 (gmt 0)

New User

5+ Year Member

joined:June 19, 2009
posts:1
votes: 0


Hello, I know that this is an old thread, but im new to cloaking, does this code blank the referrer?

<?php
$url = "http://example.com/offer1/";
header("Location: " . $url);
exit();
?>

[edited by: incrediBILL at 11:35 am (utc) on June 19, 2009]
[edit reason] exemplified URLs [/edit]

7:48 am on June 19, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Apr 30, 2007
posts:1394
votes: 0


No it doesn't, actually, the client referrer typically remains unchanged during a redirect from the server (to whatever was set before).