Join Free
+ Reply to Thread
Results 1 to 7 of 7
  1. #1

    masking prosperent affiliate url's with cnames

    Several people have asked us for more info about masking prosperent affiliate url's. It's actually pretty easy, so here we go

    What we need to do first is setup a cname in DNS that points something like click.mydomain.com to prosperent.com. I use cloudflare, so editing dns is as simple as logging in and clicking edit dns. Add a new cname record like this:

    CNAME click.highaltitudeimports.com is an alias of prosperent.com



    Click save, and move onto editing your code. Note that some DNS providers may take several hours to update the new record. Cloudflare typically only takes a few seconds.

    In your code, you need to find where you loop through your affiliate url's. In my case it looks like this:
    PHP Code:
    <?=$record['affiliate_url']?>
    We simply need to add a preg replace that changes the prosperent.com in your affilaite url's to click.highaltitudeimports.com:
    PHP Code:
    <?=preg_replace('/^(https?:\/\/)prosperent.com\//''$1click.highaltitudeimports.com/'$record['affiliate_url'])?>
    You of course need to change click.highaltitudeimports.com to whatever you used for your cname. Save, and verify that you can click your affiliate url's. They will now show up as coming from your domain, and be indexed as such.
    Attached Images

  2. #2
    Note that this does not work with images, ONLY for affiliate url's. Our images are distributed across a global CDN for speed, and as such, we already use a cname alias. You can't double alias a url, therefore you can't use this trick on our image url's.

  3. #3
    Thanks for accepting my suggestion.

  4. #4
    Anyone else getting "Error 1001 DNS resolution error" when creating the cname?

  5. #5
    You have to be on cloud flare to successfully use this solution. If you are not using CF then you will see this error.

  6. #6

  7. #7
    Well I've signed up, looks great! Just need to wait for the DNS to change. Cheers for this guide Brian.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
coupons | coupons and deals