Membership is FREE, giving all registered users unlimited access to every Acorn Domains feature, resource, and tool! Optional membership upgrades unlock exclusive benefits like profile signatures with links, banner placements, appearances in the weekly newsletter, and much more - customized to your membership level!

Deeplinking methods with masking...?

Status
Not open for further replies.

mat

Joined
Apr 18, 2007
Posts
3,838
Reaction score
181
Hi,

On one of my sites I am currently masking and directing to affiliate links with the 301 htaccess method. Example...

mysite.co.uk/go/currys.php ----> goes to currys affiliate link

I am looking for a quick deeplinking method, as clicking that link will just take you to the currys homepage, instead of products I would like to advertise from time to time...

I would like to be able to quickly make links without having to put a new link in the htaccess file every time.

Im quite happy to apply a new masking method if it means deep linking is quick and easy...
 
Here's what i use :)

Code:
<?php
header ('Location: merchantsite.com/?youraffid.html') ;?>

Save that and name it "whateveryourwant.php" then link to that.
 
I need a method for quickly deeplinking to many different products on many different merchant sites...
 
why not pass something unique to your own page and use this to decode the merchant and product

mysite.co.uk/shopping.php?product=XXXYYYYY

shopping.php can then lookup XXX to get the merchant site to redirect to and build YYYYY into the new URL along with the necessary affiliate ID's and such like.

I did something similiar for a site a while back.
 
So far I have something like this

<?php
$link=array(
'currys'=>"http://www.awin1.com/awclick.php?mid=****&id=*****",
'othermerchants'=>
'othermerchants'=>
'othermerchants'=>
);
$url=$link[$_GET['m']];
header("Location: ".$url);
?>


So when I type in:

sitename.co.uk/go.php?m=currys

It goes to the currys home page and this can simply be done for more merchants by adding them to the list. The problem I am having is calling in the exact product url onto the end.

For example this is a full affiliate window deeplink....

awin1.com/cread.php?awinmid=****&awinaffid=******&clickref=&p=http://www.currys.co.uk/martprd/product/seo/359917
 
awin1.com/cread.php?awinmid=****&awinaffid=******&clickref=&p=http://www.currys.co.uk/martprd/product/seo/359917

Assuming the 359917 is the product code

why not mysite.co.uk/shopping.php?product=1X359917

$affiliate = array(
'1' => 'http://www.currys.co.uk/martprd/product/seo'
);

use the php split function $split = split('X',$_GET['product']);

$split[0] will be the key to your affiliate array and
$split[1] will be the product code

$url = "awin1.com/cread.php?awinmid=****&awinaffid=******&clickref=&p=" . $affiliate[$split[0]] . "/" . $split[1];
 
  • Like
Reactions: mat
That could actually be perfect.... I will try it and let you know!! :)
 
Yep, thanks, that really helped!

I changed the code so that I can use it with unlimited merchants (as they all dont have easy to enter product codes)

Turned out like this.....

<?php
$affiliate = array(
'currys' => 'http://www.awin1.com/cread.php?awinmid=1599&awinaffid=*****&clickref=&p=',
'pixmania' => 'http://www.awin1.com/cread.php?awinmid=782&awinaffid=*****&clickref=&p=',
'pcworld' => 'http://www.awin1.com/cread.php?awinmid=1598&awinaffid=*****&clickref=&p=',
);

$split = split('X',$_GET['m']);

$url=$affiliate[$split[0]] . $split[1];
header("Location: ".$url);
?>

Means I can just copy and paste the standard product link onto the end and away it goes with my affiliate details included!
 
If m contains the url then it is not masked though or are you purely trying to mask the fact that it is an affiliate link?
 
I wanted a quick way to deep link without the affiliate information showing...

So now say I want to quickly link to a laptop on pcworld, I will simply put:

sitename.co.uk/go.php?m=pcworldXhttp://www.pcworld.co.uk/martprd/product/067249

Thanks,

Mat
 
Status
Not open for further replies.

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Members online

No members online now.

Premium Members

New Threads

Domain Forum Friends

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
      There are no messages in the current room.
      Top Bottom