Quantcast
Channel: fields marshall »» fields.marshall
Viewing all articles
Browse latest Browse all 10

Redirects for Affiliate Links

$
0
0

There are a few ways to do redirects to clean up affiliate links.

Here is a list of my top four

  1. PHP redirect – write the code yourself (see below ) This will work on any php based platorm.
  2. .htaccess redirect —  again write the code yourself and edit the .htaccess file. This is more techy / complicated.
  3. Use a service like Bit.ly.
  4. WordPress Users – use a plugin like pretty link. There is another one called (gocodes) but prettylink is much more developed.

Php Redirects with errors

[cc]

/* This will give an error. Note the output
* above, which is before the header() call */
header('Location: http://www.example.com/');
?>
[/cc]

Php Redirects Done Well

[cc]
header("Location: http://www.example.com/"); /* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
exit;
?>
[/cc]

.htaccess redirects done well

[cc]
RewriteEngine On

redirect 301 /recommend http://fields.mgeary1.hop.clickbank.net/ [L]

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
[/cc]


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images