ways to rescue lost traffic erroe 404 using free java script
If you paid attention to me explaining how to create invisible redirects using HTACCESS you
say the incredible ability it has to act as a catch-all for many different URLs. This means you
can use HTACCESS to rescue potentially lost traffic from 404 “Page Not Found” errors.
Tip #1: Redirect 100% of Traffic on A Parked Domain
Place this in a new text file:
RewriteEngine on
RewriteRule .* http://affid.sellerid.hop.clickbank.net
Save as htaccess.txt, upload it to your web server and rename it to .htaccess with the dot in
front.
A “period” in HTACCESS pattern matching rules means “any character” … a single letter,
number, punctuation mark, whatever. Then the asterisk (*) says, keep matching stuff like that.
So if there is *any* URL to be found, redirect to that Clickbank hoplink we’ve given.
This parks a domain and sends ALL its traffic to that given affiliate link.
I want to introduce something new with HTACCESS rewrite rules…
RewriteEngine on
RewriteRule .* http://affid.sellerid.hop.clickbank.net [R=301,L]
See what I added? The “R=301″ and the “L” … what do those mean? First of all, the R=301
means we want to do a 301, or a “permanent” redirect, instead of a regular redirect. (You can
do permanent, temporary, and regular redirects with HTTP.) This permanent redirect tells
browsers to update their bookmarks and tells search engine spiders to update their URLs.
The “L” means if this matching rule works, it will be the last rule. Say we had 5 or 10 rewrite
rules in a single HTACCESS file, if one of them works, stop looking.
(I always tend to put an [L] after all of my rewrite rules, by the way.)
Tip #2: Redirect 404s to a Search Page
All of our sites have a couple 404 errors in them. Sometimes you can’t control people going to
an outdated page, so instead of trying to redirect each and every outdated link at a time, let the
search engines sort it out.
Try this in HTACCESS:
RewriteEngine on
# if the request is not a directory, file, or a link to another file…
RewriteCond % !-d
RewriteCond % !-f
RewriteCond % !-l
RewriteRule (.*) http://www.google.com/search?q=site:%+$1 [L]
Turn on the rewrite engine as always, then the next three lines say: make sure this is not a
folder, file, or a shortcut to another file. In other words, this is probably going to be a 404 not
found error.
Next, bring in the rewrite rule. This is really similar to the parked domain HTACCESS rule, but
with a couple small differences. First of all, notice how we put parentheses around the
wildcard characters. This means we are going to save it for later (the $1 thing).
The rewritten URL looks like this:
http://www.google.com/search?q=site:%+$1
The % is a fancy way of substituting the domain name of the server we’re on. Then we have a
plus sign (which represents a space in the URL) and the path the visitor was trying to get to.
So, if your visitor is trying to get to http://www.example.com/fishies … they will be redirected to:
http://www.google.com/search?q=site:www….
Which means we’re basically placing “site:www.example.com fishies” in Google’s search box,
and if you know how to use Google’s advanced features, that means: search for the keyword
“fishies” but limit my results to matches coming from www.example.com.
Not only can this be used to rescue 404 traffic, it can be used to make using your site more
convenient. The site www.php.net does something similar to this. They use their own internal
search script instead of Google, but it’s the same idea. I want to look up a PHP function like
“date” for displaying the current date. Instead of going to www.php.net and typing “date” in the
search box, I can just type www.php.net and it will take me right to that page.
I wish more sites would do this. How many times have you gone to www.dictionary.com or
www.affiliatebattleplan.com) and the
reason I priced it so high was because of the HTACCESS snippet I’m about to show you…
RewriteEngine on
# if the request is not a directory, file, or a link to another file…
RewriteCond % !-d
RewriteCond % !-f
RewriteCond % !-l
RewriteRule ^([A-Za-z0-9]+)(/)?$ http://$1.YourClickbankID.hop.clickbank.net
[L]
(Substitute the YourClickbankID in there with your real Clickbank vendor ID.)
That will take your 404 traffic, substitute the URL path as an affiliate’s Clickbank ID, then
redirect through Clickbank’s server to make sure that affiliate gets credit.
In other words…
1. an affiliate with the ID “simplephp” links to you like this: http://www.example.com/simplephp
2. HTACCESS redirects the user to: http://simplephp.YourClickbankID.hop.cli…
3. The visitor is redirect back to your site and will now be credited if any Clickbank sales go
through.
Neat, isn’t it? Your affiliates don’t have to remember what Clickbank’s hoplink syntax is, don’t
have to setup their own cloaking links if they don’t want to, or anything
Tip #4: Clickbank Paylinks
If you don’t want to do the redirect, we could go back to the idea of the simple redirect.
Clickbank allows you to link to an order form and credit the affiliate in one step. The format is:
http://ItemNumber.Affiliate_Vendor.pay.c…
All we need to do is change the rewrite rule to pass that Clickbank ID to our script as the
“affiliate” parameter.
Start off with a sales page, save this as index.php:
<h1>Hello, Friend…</h1>
<h2>Subheadline Goes Here</h2>
<p>The rest of my sales page goes here.</p>
<p><a href=”#”>This is my $37 order link.</a></b></p>
Now add some PHP code right above it:
<?php
// Clickbank item number for the vendor paylink
$item = 1;
// Clickbank vendor ID
$vendor = “YourClickbankID”;
if (isset($_GET[”affiliate”]) && preg_match(’/^[A-Za-z0-9]+$/’, $_GET[
“affiliate”])) {
$affiliate = $_GET[”affiliate”];
$payLink = “http://$item.” . $affiliate . “_$vendor.pay.clickbank.net”;
echo $payLink;
}
else {
$payLink = “http://$item.$vendor.pay.clickbank.net”;
}
?>
And finally make that order link go to whatever $payLink was set as in the script.
<p><a href=”<?php echo $payLink ?>”>This is my $37 order link.</a></b></p>
I know that looks like a lot of confusing code but it really isn’t. If HTACCESS passed the
affiliate name in the form of “index.php?affiliate=simplephp” to the script, set the payment link
as:
http://1.simplephp_YourClickbankID.pay.c…
If there is no affiliate, use the regular payment link:
http://1.YourClickbankID.pay.clickbank.n…
There you have it. Tons and tons of ways to take advantage of lost traffic… isn’t all this better
than an ugly 404 Not Found page?
Read Related Post










