Need helpp for redirect for affiliate links

7 replies
I am working on creating some affiliate links on one of my blogs and in some ebooks with many more to come. They work fine, but I always hear how much better it is to have redirects on them so they look nicer.

I have found instructions to do this by searching Google, but they are all "above my head." Can someone tell me a very simple way to do this? With complete instructions written for a very NON-programmer?

I do use Dreamweaver.

Thanks in advance!

Jeanne
#affiliate #affiliate links #helpp #links #redirect #redirects
  • Profile picture of the author Dan Grossman
    There are three ways to redirect someone from one URL to another:

    1) Client side with a meta tag in the head of the HTML. Make a page with the URL you want, and put a meta tag in the <head> section redirecting to the affiliate URL:

    HTML Code:
    <meta http-equiv="refresh" content="0;url=http://example.com/affiliate.php?cid=12345">
    2) Client side using JavaScript. Make a page with the URL you want, and put this script in the body of the page:

    HTML Code:
    <script type="text/javascript">
    <!--
    window.location = "http://www.example.com/affiliate.php?cid=12345"
    //-->
    </script>
    3) A server side redirect by sending a location header. There are many ways to do this, from Redirect or Rewrite rules in your .htaccess file for Apache, to sending the header from your favorite scripting language. An example using a PHP page that redirects to an affiliate link when accessed:

    Code:
    <?php
    header("Location: http://www.example.com/affiliate.php?cid=12345");
    exit;
    ?>
    The first method works in most browsers but does not redirect until the page has started loading. The second method works in browsers that have JavaScript enabled, which is probably 98% of them. The third method works in all browsers and redirects before the page starts loading, so it is the fastest redirect.
    Signature
    Improvely: Built to track, test and optimize your marketing.

    {{ DiscussionBoard.errors[106159].message }}
    • Profile picture of the author lakewaytexas
      I had found some info on Google about using the .htaccess file to do this, so I had gotten this far before I saw your response. Perhaps you can help me from here.

      This is the coding I got from Commission Junction (with changed affiliate numbers):

      <a href="http://www.dpbolvw.net/click-4353333-77788888" target="_blank">
      <img src="http://www.awltovhc.com/image-4353333-77788888" width="120" height="60" alt="" border="0"/></a>

      I copied this code to my blog. The link and image shows up fine. When I click on the image, it goes to cooking.com and the URL says:

      http://www.cooking.com/?ref=http%3A%...grandma.com%2F

      It is actually on one line. I don't want all those ugly numbers to show, so I tried using my .htaccess file.

      I have this line in my .htaccess file (it is all on one line):

      redirect 301 /goodcooking http://www.dpbolvw.net/click-4353333-77788888

      I saved it and uploaded it.

      I thought that when I now selected the image for cooking.com that the URL would show , but it still shows all the ugly numbers:

      I must be missing something here...

      Am I supposed to put something different in the recipe site other than the code I was given from Commission Junction?

      I am so confused. Help!! Thanks, and remember, please give me real basic info - I am not a programmer.

      Jeanne
      {{ DiscussionBoard.errors[106453].message }}
      • Profile picture of the author lakewaytexas
        I see that my link resolved when I didn't want it to! Hopefully you can figure out what I mean...
        {{ DiscussionBoard.errors[106458].message }}
  • Profile picture of the author Dan Grossman
    You set a rule that when Apache gets a request for the URI /goodcooking on your site, it should send a 301 Permanently Moved header and redirect to the affiliate link.

    That doesn't change your HTML. Now you need to link the ad to /goodcooking instead of directly to the affiliate URL now.
    Signature
    Improvely: Built to track, test and optimize your marketing.

    {{ DiscussionBoard.errors[106595].message }}
    • Profile picture of the author lakewaytexas
      I changed what I had in the blog to

      http://www.recipesfromgrandma.com/goodcooking instead of the code I got from Commission Junction. I thought that would do the trick, but now I get this error message:

      Not Found
      The requested URL /goodcooking was not found on this server.

      Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

      ---

      There is a lot of stuff in the .htaccess file for the blog (much more than shown here). I tried putting this line at the top of the file, and it disappeared after I saved it. I tried putting it at the bottom of the file, and it disappeared again. This time I put it here:

      # BEGIN WordPress
      redirect 301 /goodcooking http://www.kqzyfj.com/click-3136013-10377603]
      <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /
      RewriteCond %{REQUEST_FILENAME} -f [OR]
      RewriteCond %{REQUEST_FILENAME} -d

      Is that the right place for that line of code? Why would it disappear after I saved it?

      Thanks again. Jeanne
      {{ DiscussionBoard.errors[106647].message }}
      • Profile picture of the author dddougal
        I dont see the point in re-directing unless you want to count the clickthroughs. If all you want to do is hide the affiliate link then you might as well just cloak your links. If you want to track them theres a free little script called PHP Click Counter...Im not affiliated with these at all but I have used it a few times, works great.

        Click counter and download counter
        {{ DiscussionBoard.errors[112907].message }}
  • Profile picture of the author dddougal
    I dont see the point in re-directing unless you want to count the clickthroughs. If all you want to do is hide the affiliate link then you might as well just cloak your links. If you want to track them theres a free little script called PHP Click Counter...Im not affiliated with these at all but I have used it a few times, works great.

    Click counter and download counter
    {{ DiscussionBoard.errors[112905].message }}

Trending Topics