Quote of the Day
Web Redirection Methods Explained
April 28th, 2008 | 28 comments
Many of you know that I’m fairly “technically challenged” and that causes me to outsource much of the technical aspects of my business.
One question I get alot is on redirects. What does each redirection method do and what are the pro’s and con’s?
Although I do know the basics and do alot of redirects myself, I wouldn’t feel comfortable giving advice on the subject. So, I found someone who knows quite a bit on the subject, Alan Peterson from IMNirvana.com and he’s agreed to an in-depth guest post on the subject of redirects.
————————————————————————————————————————-
The question of website redirection is one of the most frequently asked questions being asked at the popular webmaster/Internet marketing forums. There are several reasons why you would want to redirect traffic from one site to another. Perhaps, you’ve decided to change domain names or you’re promoting another site as an affiliate. Lets take a look at those two redirection scenarios and the best way to use redirection without losing site authority or violating affiliate program rules.
Search Engine Site/Page Redirection
The best way to prevent the possibility of losing any page authority your site has already earned is to not redirect it. However, sometimes a domain change is just inevitable. Perhaps you’re re-branding your site or you just need to redirect a specific folder or file. For whatever reason you may have–you want to minimize any negative impact from Google.
301/302 Redirect
The easiest way to do this is by a 301/302 redirect. Basically when a visitor lands on the old URL they will be redirected to the new URL. This happens behind the scenes and usually unbeknownst to your visitor.
There are many types of redirect (HTTP, Meta, CGI, etc.) but those methods can be considered black hat by the search engines because they can be used to trick the search engine for the purpose of gaming them. The most search engine friendly way of redirecting is by way of 301/302 redirect. Google accepts that as a proper way to redirect sites and pages.
Most of the advice online on the subject of redirection is doing a 301-redirect. A 301 redirect means the redirection is permanent. There are several response codes all beginning with 3 that redirects a browser to go to another location. The response code simply tells the browser and bots if the redirect is permanent (301) or temporary (302). There are a few other response codes but for our purpose we will only use 301 and 302 response codes.
Although, 301 is the most popular and often recommended way to redirect your site or page, it might actually do more damage than good, at first.
The 301 redirection is instant but in the world of Google and search engine algorithms it’s not automatic. Google places a lot of importance on domain aging so if you’re doing a 301 redirect you might end up playing catch up. Meaning the page ranking and authority you’ve worked so hard to achieve could be gone. Google could send your old site to no-man land while they catch up to the new domain.
Redirect in Two Phases
The best way of tackling your redirection is in two phases. Phase one is 302 redirection.
Several SEO experts suggest you first use a 302 temporary redirect at first–which flags the move as a temporary redirect.
A 302 redirect allows the original URL to stay in Google’s index so you maintain your site ranking and authority since the page is still there. But visitors who click on that original link will be taken to your new URL, which is where you want them to go anyway. You accomplish your redirection goals while keeping the status quo of your old page with Google.
Like a good wine you want your new URL to age. Begin your linking campaigns to the new site right away and let the new domain age for at least 6 months. Once your new domain begins to pop up in the rankings you can move to phase two: 301 redirection. Now it’s safe to make the redirection permanent. Simply change the status code from 302 to 301 and you’re good to go. And don’t forget to let your linking partners know about the change so they can update their links to your new domain.
How to do site redirection
The actual redirection process is very simple and you do not need to be a tech geek to do it.
A server side redirection is the simplest and fastest way to do this. That simply means the redirection is done from your hosted account’s server rather then from your visitors browser. This makes the redirection a lot faster since it’s happening from the server and you keep control of the redirection since it’s occurring on your domains server.
If your host is using a Linux server with Apache Mod-Write enabled, you can use a directory-specific .htaccess file for your redirection by simply adding a single line of code to your .htaccess file:
Redirect 302 /oldpage.html http://www.example.com/newpage.html
To change domain names add this code to your .htaccess file:
RewriteEngine On
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=302,L]
The .htaccess file is found in your root directory. If you don’t have one you can create one your self. If you’re unsure if your host uses Linux/Apache server just ask them.
If your host doesn’t use an Apache server, you can still use the 301/302 redirection using a scripting language called PHP.
It’s a very simple process and you do not need to know PHP, you just need to copy the following PHP code and paste it to your old sites index.html file and change the extension to index.php instead of index.html. Then replace the URL with the URL of the site you will redirecting to.
< ? Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: http://www.newdomain.com" ); ?>
Affiliate Link Cloaking
Another popular use of redirection is to cloak your affiliate links. It’s a good business rule to not use naked affiliate URL’s since they leave you vulnerable to link hijackers and by-passers which will will cause lost commissions. Your affiliate links will also look more professional and you’ll be branding your own URL, which is always a good idea.
What looks better?
http://www.affiliate-programs-url.com/funkyandweirdlookingcode?thatjustdoesntlookgood_aff?_ID1232998
Or http://www.YourUrl.com/Recommends/Product
There are several software products in the market that will redirect your affiliate links for you but you can easily do it for free.
PHP Redirect
Although there are several ways of doing this, in my opinion, the best way again is doing the redirect using a server side scripting language called PHP. All you need to know is how to copy and paste and upload the file to your web server via FTP or Cpanel.
This is the code you will need:
< ?php
header("Location: http://affiliateurl.com");
?>
Copy and paste that code into notepad. Replace the dummy URL with your actual affiliate URL. Save the file as a .PHP. And now upload it to your server. That’s it. I use the product name for my file naming convention and I upload the PHP file to a directory on my server called “Recommends”. That way the URL redirect will look like:
http://www.YourURL.com/Recommends/ProductName.php
Using redirection will not only shorten and make your affiliate URL’s more professional they will reduce your exposure to link hijacking and bypassing. You also maintain control for your redirection campaigns. If a merchant stops selling a product or shuts down their affiliate program you can easily change the redirects since they’re occurring on your server.
So whether you’re changing domains or you want to cloak your affiliate links you will find server side redirection is the best choice.
Alan Petersen has been an affiliate marketer since 2005. He is the author of The Definitive Guide to Link Cloaking and maintains an active Internet marketing blog at www.IMNirvana.com. To grab a copy of Alan’s Link Cloaking Guide, go to http://linkcloakingguide.com
photo credit: Leo Reynolds
Popularity: 15% [?]
To be notified of future posts, consider subscribing to my Full RSS feed!
Related Posts
- Internal Linking and PageRank Leakage
- Can a Newbie Really JV with the Big Dogs?
- Still Think Google is Evil?
- Latent Semantic Indexing Explained
- Page 1 for “Make Money Online” How I Got There
- Finding HOT Niches is about to Become Much Easier!
- Google PageRank and Alexa Traffic Ranking Explained
- Make Easy Money Online with Article Arbitrage
- 20 Ways to Make $100 a day Online
- 10 Ways to Increase your Adsense Income










28th April, 2008 at 5:03 pm
Josh,
I know ezinearticles allows you to use a top level domain for your resource box to redirect. Do you know which type of redirect is best for this in terms of search engine friendly? My domain register allows for a few types of redirects (one I think keeps the url and the other displays the new url it forwards to).
Debbie
28th April, 2008 at 5:12 pm
The code block that has ? without php is in error. ? alone does not work on all servers.
28th April, 2008 at 5:14 pm
@ Deb - If you’re using this TLD to redirect to an affiliate link, which I’m sure you are, then it doesn’t matter. The affiliate link will never rank in the SERPS anyway.
For this I would do a 301 and redirect your affiliate link to a custom page within a directory like yoursite.com/recommends/product
But as far as SE’s, in this situation it wouldn’t matter what they think of the redirection method. The article may rank, but the actual affiliate link isn’t going to.
@RT - I’m sure there are many things that may or may not work on every single server configuration out there. Do you know of a solution or are you just saying this may not work on all servers?
28th April, 2008 at 5:18 pm
This article is very useful to me since I need to change the domain name of one of my domains and I don’t want to lose the authority that I have achieved.
How does affiliate link hijacking work? If they copy my banner with my identification, that obviously won’t help them. Do you mean that they copy my article and insert their own banner? They would be able to do this if I cloak it also.
Please expand on this so that the benefit of affiliate link cloaking could be better understood.
28th April, 2008 at 5:24 pm
@ Computer - Here’s an example.
I find a product that I like, so I want to recommend it to my subscribers. I get my affiliate link and send it to everyone.
My subscribers see that it’s an affiliate link so they just sign up as an affiliate, clear their cache and order through their own link.
This especially happens with ClickBank products, as they allow people to order through their own links.
There are also some people who just don’t want someone else to get credit for their purchase, so if they see that it’s an affiliate link they’re just clear their data and order straight through.
There are many benefits of link cloaking and these are just a few.
28th April, 2008 at 5:34 pm
Hi Josh
I’ve been reading your blog for some time and it’s a very good one, with lots of good info. This post is very usefull, specially in what’s related to affiliate link protection, it’s a growing problem in the internet and many many affiliates are losing huge amounts of money. The worst part i believe is that companies like clickbank or paydotcom aren’t doing anything to protect their affiliates, according to lots of people they’re letting people with spyware programs become affiliates and those are the ones highjacking serious affiliates profits. I became an affiliate for clickbank some weeks ago, in the first days i was making some money in a regular way, suddenly it all stoped, so i suspect that my id might have been stolen, i know that many affiliates are now leaving click, because they’re not getting protection from them, i’m doing the same too, but if these things continue to happen the entire affiliate business will be in risk. I know that you have been working with CJ, or at least is what i understood from ebooks i’ve read from you, is it safer? or it’s having the same problems? Thanks Josh
28th April, 2008 at 5:42 pm
Hi Josh…thanks for getting Alan to talk about this. There is a lot of mystery on the purpose of doing redirects. My question is I use a server side 301 redirect for one of my new domains in order to have my “www” indexed and keep some of my pages out of supplemental but now after reading this article I’m not sure if this is right.
Alan says to use a 302 first…is this for an older domain? I’m doing it to prevent having “Mydomain.com” and “www.Mydomain” competing with eachother for some Google love and risking getting hit with a duplicate content penalty. Am I correct with this? Or have I just confused everyone?
Mark
28th April, 2008 at 5:56 pm
“The code block that has ? without php is in error. ? alone does not work on all servers.”
Josh, what I’m saying is that the short version “?” alone works on few servers whereas “?php” works on all php-enabled servers.
28th April, 2008 at 6:00 pm
Very interested in the cloaking. I will try this with clickbank.
Have this chap back again in the future.
Neil
28th April, 2008 at 6:15 pm
Josh
As you suggested, there is a lot more to redirects …
This post is great as it gives a good start to the subject but I think anyone interested needs to learn more about the subject as their redirects could have implications they don’t expect.
For example Debbie has mentioned an important point … for affiliate marketing, redirects do indeed cloak the link BUT most end up revealing it at the other end (in the browser address bar after redirection is complete and the page is being displayed).
A common method for registrars’ DNS control panel to hide the destination URL is to “frame” the destination page. This works fine though it may be against the terms and conditions of your affiliate merchant (do check first).
Something to look out for is an emerging group of good quality merchants who immediately cookie the prospect with your affiliate ID and strip your id from the browser address bar thus giving you the best chance of getting credit for your effort. Those merchants deserve your long term support the most.
Sami
28th April, 2008 at 6:28 pm
@ Josh
“My subscribers see that it’s an affiliate link so they just sign up as an affiliate, clear their cache and order through their own link.”
“There are also some people who just don’t want someone else to get credit for their purchase, so if they see that it’s an affiliate link they’re just clear their data and order straight through.”
Isn’t the cloaking easy to get around? For example, someone goes to the vendor’s page via my cloaked link and looks up affiliate information or the the person could simply search for affiliate information about the product and determine the organization handling the affiliate marketing.
It takes a little more work but they could still get around using my link.
Additionally, there seems to be the implication here that spyware or some malicious party could rip me off even when someone clicked on a banner on my page. How would this be done?
28th April, 2008 at 6:50 pm
Josh,
Very well stated. I’ve been using the php redirect for a couple of years now and it works great. I would recommend against the tinyurl and similar sites because it screams affiliate and doesn’t allow you to develop any branding of anything. Even if you don’t have a niche website to brand, get one for you name or your company name and send your links through that web address (don’t actually need a site). Looks better for those that care.
28th April, 2008 at 6:50 pm
Hey Josh,
Very helpful.
It never ceases to amaze me
that no matter how much we learn there are always subjects that we avoid.
I have put off learning about redirects forever. This post makes it very easy to
understand and apply.
Once again, thanks.
Best,
Scott
28th April, 2008 at 7:41 pm
Hello,
I’m glad you’re finding this post useful. And no–redirection isn’t 100% fool-proof. A determined thief is hard to stop online and offline.
But it does even out the playing field a bit in your favor. Thieves are lazy so most won’t go the extra steps to figure out your cloaked affiliate ID source.
Malicious software distributed by ad/spyware is a problem not discussed much. It’s usually piggybacked on other software like those emoticons folks download not know that they’re infesting their computer with spyware.
When these folks click on your affiliate ID the piggybacked software automatically rewrites affiliate links on pages you visit with their own–giving themselves the credit - and thus the commission for the sale.
@RT Cunningham - Good point. Better safe than sorry use <?php as your opening tag.
@Mark - In your case I would use 301.
Regards,
Alan
28th April, 2008 at 10:20 pm
Thanks, Josh!
This is an excellent resource for people who like to KNOW how things work!
Software that does this might not work as intended. If the problem is due to user error (read “Janie pushed the wrong key somewhere!”), then I am better able to know how to correct the mistake. Good show!
28th April, 2008 at 10:23 pm
Thats one of the best explanations of 301 and 302 re-directs I have read in sometime. Good job.
I occasionally use redirects on my mmo blog, btu more often than jot it leave it naked. I figure if some one is gonna rip it theyre going to go sign up and get it themselves, in other niches they have no idea what a hoplink is so I dont use them either weird huh.
Though I have read that goog doesnt like hoplinks, or prefers redirs? can anyone illuminate that aspect
28th April, 2008 at 11:43 pm
Nice post Josh.
With affiliate links he key point is control - especially when an affiliate link needs to be changed. Too many people throw out hard coded links to dead end products…
29th April, 2008 at 6:53 am
[...] Spaulding recently had a pretty good guest post on his blog covering the uses of web redirection, especially in regard to affiliate marketing. The one thing that post lacked was a good practical [...]
29th April, 2008 at 6:57 am
Good topic Josh, there are actually some free WordPress plugins that make redirect link creation really easy as well. You can find out more in my latest blog post.
29th April, 2008 at 12:29 pm
[...] Web Redirection Methods Explained Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages. [...]
29th April, 2008 at 6:00 pm
Hi Josh,
After trying to read this post and yes trying to read . . . I was lost once I got to the how to do part . . . I can see why you have your tech stuff done for you. Even though I did try to understand it I was totally lost. For anyone who can understand it, I’m glad for them.
I guess some things are just beyond my scope of understanding. However, I am glad to have come across this post as it gave me a little more understanding on the subject as what I had before.
BTW I love your blog design.
Heidi
29th April, 2008 at 9:13 pm
Hi Heidi,
It can be very confusing and that is why it’s a common recurring question on the forums and blogs. I would suggest using a script/software program that does the redirection for you. That way you don’t have to deal with the technical aspect. There are many in the market varying in price from free to over $100.
Free Link Cloaker is a nice script and it’s free! http://freelinkcloaker.com/
Alan
1st May, 2008 at 9:29 pm
Finally! A decent explanation. I did however purchase and have been using adtrackz gold…seems to work very nicely for cloaking/tracking and so forth.
Thoughts on the software?
3rd May, 2008 at 12:25 am
[...] 2. Web Redirection Methods Explained. [...]
3rd May, 2008 at 3:49 pm
Does anyone know, when you do a redirect, can the affiliate program manager tell what url the click came from or is the original referral data stripped once it is redirected?
4th May, 2008 at 1:36 am
Just redirect to the URL that you’ve been given by your affiliate manager.
I’m 99.9% sure that you’ll be fine.
10th May, 2008 at 2:40 pm
[...] I get alot is on redirects. What does each redirection method do and what are the pro??s and con?http://ez-onlinemoney.com/blog/technology/web-redirection-methods-explained/URL Cloaking and Why You Should Avoid ItGood little blog post of what url cloaking is and why not to [...]
11th May, 2008 at 3:44 am
I’m a little late on reading this, had it open in my browser for days now. Glad I finally read it. I always new how to re-direct just never knew which ones were better and why.
Thanks