Understanding Web Page Redirection, the smart way
This article is intended to help you understand web page redirection and some of the technologies involved with doing so.
If you are looking for a more comprehensive guide to redirecting your page. Or if you are anxious for code samples on redirecting your page, then please reference this article: How to redirect a web page, the smart way.
What is Web Page Redirection?
Well, obviously this is simple, and not very complicated; redirecting a web page just means that you get transfered to another web page when accessing the current page or attempting to. That is pretty clear.
What isn’t clear — is that there are really at least 2 major different forms of web page redirection; Client-side Redirection & Server-side Redirection
What is Client-side Redirection?
Well in this context, it’s your browser. More specifically: the contents of the web page your browser literally downloaded is the client (html). Because when you visit a web page, that page is downloaded and stored temporarily on your computer (also known as being cached).
What is Server-side Redirection?
Basically, as a user visiting a web page — you can’t see anything that happens on the server-side.
This means that when a redirection occurs on the server-side, the only way you see it is that the original URL you were contacting suddenly changes to the new URL that the server-side is redirecting to. This is typically the best way to go about redirecting, because it is really the only “safe” way of communicating to a search engine “Hey, this page has been moved, here is the correct URL”
With that said, it is important to understand the different types of URL redirection. Ultimately, the redirection occurs when your browser or client is instructed of the redirection. My rule of thumb is to not ever redirect unless it is permanent. That doesn’t necessarily apply to everything, but it is a safe route.
The 301 redirect is really the only redirect I use, because it is intended to be a permanent redirect, and search engines recognize this.
What should I stay away from?
In short: Client-side Redirection. These methods of redirecting a web page range from using html meta tags, to javascript, and even using flash embedded on a page to redirect. All of these methods are notorious for getting you de-indexed from search engines, or at the very least, you’re page getting automatically penalized from search engines. Stay away from client-side redirection, unless it is user-initiated (like clicking on a link).
That pretty much sums it up. It is important to keep in mind that if you are trying to redirect your page, do some research to find out exactly which redirect is right for you.

Lary Stucker said,
January 11, 2010 @ 8:10 pm
In iis is there a way to create a 301 redirect on the server side where I don’t have to leave the old file in place? We chenged the directory strucutre of our site and want to delete the old files once we have our 301s in place.
Maynard Hidrogo said,
January 6, 2010 @ 2:36 pm
Where do you get this information? Thanks a lot
David Becker said,
December 22, 2009 @ 10:16 pm
Hi Steven,
I’m having an issue with my web host. All I want is a permanent redirect from http://elearningconsultant.com.au to http://www.elearningconsultant.com.au because I’m told my page rank will be diluted without it. Firstly is this true? and secondly why is my ISP saying it cant be done? They are running IIS and I sent them some links on how to do it on IIS. Thier last email was:
I’ve had a look at the links your provided and while you can indeed
provide a permanent redirect to _another_ site, if you redirect your
site permanently to your site, I think you would cause a looping error.
HT access files do not form a part of the windows IIS server framework,
and as such don’t work on windows IIS servers.
Unfortunately after much discussion in the office we are not able to
offer you another solution other than Joels initial one.
Joels solution was:
There is no way to redirect from non-www to www with IIS. The only way
this can be performed is in the code of your website.
The way Deepna set it up earlier would be on for people going directly
to your domain, but if they browse to a page on your domain, it would
not be able to redirect them as it only redirects access to the
index.html page.
Essentially, the only way you will be able to set up this redirect is to
write some code that is on each page of your site, that checks the URL
for the ‘www’ and if it doesn’t exist, redirects people to the correct
place.
Unfortunately there’s no easier way to accomplish this that will cover
every URL people will browse to.
I only want the domain redirected, not every page. Anyway I’m not technical enough to offer them a solution, so any suggestions you can give me are greatly appreciated:)
Happy holidays!
Dave
Daniel Bely said,
April 9, 2009 @ 6:13 pm
Very nice and helpful article. Thanks!
jeffrey said,
March 8, 2009 @ 6:50 am
Hi,
We are planning on using wordpress mu for hostings our clients blogs while at the same time giving them the option to have their blogs redirected to their own domain name.
We would prefer to set up each clients blogs in their own sub directory versus sub domain.
I would appreciate if you could share your opinion/ thoughts on redirecting each clients blogs from the sub directory to there domain name using 301 redirect.
e.g ourdomain.com/user1/blog to their domain e.g. blog.theirdomain.com or theirdoamin.com/blog
Thanks,
Jeffrey
Steven Hargrove said,
January 22, 2009 @ 4:28 pm
@Tim:
These articles I have written we’re mainly intended for redirect advice in regards to search engine optimization.
In summary, javascript/meta redirects are not a bad thing if you don’t care about SEO. (like on an intranet)
Tim said,
January 22, 2009 @ 9:19 am
Hi,
To echo Paul’s question, what if I am maintaining pages using a CMS where I have no server access but I can add html and javascript to my page? Also bear in mind I have no concerns regarding search engines on my password protected intranet.
For me your articles are at best unhelpful and at worst dismissive. It tells me to do something I can’t do and doesn’t tell me how to do something I could do (because apparently to do so would be rubbish).
It wouldn’t hurt you to include a couple of lines of client side code with caveats.
Tim
Brendan said,
January 19, 2009 @ 12:04 pm
“it is intended to be a permanent redirect”
Does that mean that it is permanent, or just intended to be? I intend to use this to link a couple different domain name variations to one site, but will I be able to remove the redirect if I want to move the main site to that hosting service?
Jim Titus said,
January 10, 2009 @ 11:11 am
Thank you very much for posting this article and related comments. Unlike most of your commenters, I am a total amateur. I have perhaps the oldest site on my particular topic, which consists largely of government reports that I wrote before 1997, and uploaded onto the free webpace that came with my dial-up ISP a few years before the federal agency for which I work got around to creating a web site. So there are alot of old links that have accumulated from other researchers, federal agencies, NY Times, etc. The problem is: the ISP doesn’t have high-speed so I have been paying for a full ISP account just so my web site does not lose the google ranking. And I only get 10 meg so I put some of the site on my father’s free space (same ISP) a few years ago… It is time to move to real webhosting. Needless to say, I didn’t bother buying a domain name which at the time cost $100 plus about $50/yr. So my main page was at http://www.OldISP/myname.html
So I bought a domain name and a webhosting account, and before even moving my site to the new server, I set up the new domain name to forward to my old web site. But of course that only works for the part of the site on http://www.OldISP/myname.html. Anyway, I have the website of what had been on my father’s ISP copied onto the new webhosting, and the time has come to start putting in 301 redirects. Before actually killing the old part of that site, I decided to implement a test, but the test doesn’t work.
As far as I know, I created an .htaccess file with a single line of code (which copy):
redirect 301 test.html http://users.rcn.com/jtitus/Holding/NRJ.html
I say as far as I know because I used “Notepad” which saves as .txt and then I simply edited out the .txt from the extension name. I uploaded this file into the same directory as my index.html. So I assume that if I change “index” to “test” within the larger URL of my main page, that it should forward to the second destination NRJ. But instead I get a 404 error.
I have written the ISP but they take several days to write back on these matters, and are focussed more on their own system than solving a problem–and really, what incentive do they have to help me move off their space anyway other than (perhaps) looking a bit better for not being known for dead links? Any thoughts would be very much appreciated.
Best regards
Jim
Darko Zganjer said,
January 5, 2009 @ 6:38 pm
and the same for adding www to adomain.
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(yourdomain\.com) [NC]
RewriteRule ^(.*) http://www.%1/1 [r=301,L,NE]
a]
RewriteCond %{REQUEST_URI} !^/(robots\.txt|favicon\.ico|sitemap\.xml)$
RewriteCond %{HTTP_HOST} !^www\.askapache\.com$ [NC]
RewriteRule ^(.*)$ http://www.askapache.com/1 [R=301,L]
b]
#Options +FollowSymlinks
RewriteEngine On
RewriteCond %{http_host} ^yourdomain.com
RewriteRule ^(.*) http://www.yourdomain.com/1 [R=301,L]
c]
RewriteEngine on
RewriteCond %{HTTP_HOST} yourdomain\.com [NC]
RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com [NC]
RewriteRule ^(.*) http://www.yourdomain\.com/$1 [L,R=301]
Darko Zganjer said,
January 5, 2009 @ 6:37 pm
You have a very useful website. Thanks.
I have seen many different methods of redirect and I guess everyone has reasons for there way, but no one ever explains the differences and benifits to different ways. just that theres is the best. and everyone has an opinionon blogs etc.
can you help out? thanks.
a
#Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.olddomain.com$[OR]
RewriteCond %{HTTP_HOST} ^olddomain.com$
RewriteRule ^(.*)$ http://www.newdomain.com/1 [R=301,L]
b
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?olddomain\.com
RewriteRule (.*) http://www.newdomain.com/1 [R=301,L]
c
RewriteCond %{HTTP_HOST} !^www\.olddomain\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http://www.newdomain.com/1 [L,R=permanent]
Paul said,
December 19, 2008 @ 2:01 am
What should one do if they do not have server side abilities like .htaccess, php etc.?
Steven Hargrove said,
August 24, 2008 @ 4:15 pm
@Scott:
This is actually expected behavior. You have to keep in mind that when you change something on your site (like adding a 301 redirect) - you can’t expect Google to mirror you’re expectations. It’s a waiting game.
What’s happening is; Google is re-analyzing your new site. IT IS a new site, whether its a domain transfer or not. I highly doubt the age of the domain itself holds any weight. However, rather the age of a site actually existing on that domain is much more of a factor.
The 301 redirect you are performing from you’re *old site* to you’re *new site* is correct per-say. However - yes, any links pointing to you’re old site should be redirected to the new one, thus Google will recognize this eventually.
You have to look at it in a non-linear fashion - you have changed you’re domain name! This means, that in terms of SEO - a lot of the old work you may have done on you’re old domain - you will have to do again on the new domain. It’s a waiting game for the most part.
As for you’re question “should I just switch it all back to thew old domain name?” - well I can’t say for sure what the effects would be. However my guess would be that google would eventually recognize this. You may have a good amount of time (1-2 months maybe?) before you’re site shows back up in its previous ranking. If you’re looking for immediate results, you won’t find any - but this is probably the fastest positive results.
Was there any other purpose surrounding changing the domain name, other than the name was better? Because in my opinion, that certainly doesn’t justify an entire domain transfer when talking about SEO.
Hope that helps.
Scott said,
August 24, 2008 @ 4:37 am
Another thought. Is it to late to revert back to the old domain? Would this look strage? Should we site tight and sweat it out?
Scott said,
August 24, 2008 @ 4:32 am
Our old domain http://www.ezwatchstore.com was a good site with a pr of 5 and we rated up on the first page of several great volume search words such as security cameras and video security. We wanted to move higher and all indications were that a more descriptive domain such as http://www.ezwatch-security-cameras.com would help. So we performed a 301 redirect. Well everything stayed the same for a about a week. Then overnight we fell off every first page search. We found ourselves on page 3,4 and 5 of a search. A week later our precious pr of 5 went o 0. The only thing we changed was the domain. Ouch.. I later realize the old domain was just that, old. 5 years, and the new domain was well, new. 2 months. Any suggestions?
Rick Lim said,
August 23, 2008 @ 10:28 am
Thanks for this great tutorial.
Randall Glass said,
July 26, 2008 @ 10:41 am
You nevered answered Colin Miller’s question.
I would like to know the answer to whether a 301 redirect would affect your google ranking.
Say like from a site with poor google ranking to a site with good google ranking or
visa versa.
Would some other redirect work better in this cause.
I hope you can answer this question.
Randall
Colin Miller said,
June 13, 2008 @ 3:40 pm
So… If I want to move a site from a domain that has good PR to a new domain that is more keyword orientated (using 301), would the page rank transfer? Or would I lose it?
The new domain actually consists of good keywords that I am most searched under, whilst my current domain doesn’t, its just my name. i would be interested in your your thoughts on this, it’s a pretty big gamble, but you may know the answer
Joe said,
May 29, 2008 @ 12:54 pm
Hi Steve,
The articles are excellent. I have a question that I would like to ask to see if you can offer any advice.
We are redoing our company website, keeping the same domain name but the pages will be different. We are moving from an old, antiquated structure to a Joomla-based website (on Linux) with SEO.
We are using Redirect 301s in our .htaccess file for pretty much all of the pages, and our tests show that they work fine. The issue is this:
In the old website, my top-level Support page was:
http://www.mydomain.com/support/tech-1.asp
In the new website, the top-level Support page is:
http://www.mydomain.com/Support/Tech-Support-Overview.html
So, we put in a Redirect 301 as follows (which works fine):
Redirect 301 /support/tech-1.asp http://www.mydomain.com/Support/Tech-Support-Overview.html
So far, so good. However, in various documents we send out to customers, we tell them that if they have any support questions, they should go to:
http://www.mydomain.com/support
In the old website, if you typed that into the browser you immediately were redirected to http://www.mydomain.com/support/tech-1.asp.
However, typing it into the new browser brings a 404 error page.
In order to rectify this, I proposed that we place a new Redirect in .htaccess as follows:
Redirect 301 /support http://www.mydomain.com/Support/Tech-Support-Overview.html
My MIS person refuses to do this, saying that the initial URL _MUST_ be a page/file with an ending like htm, html, asp, php, etc.
Is this correct? If so, do you have any advice?
Many thanks.
Joe
Steven Hargrove said,
May 22, 2008 @ 11:19 pm
Chris M,
I can not guarantee that a 302 won’t effect your search engine rankings. However, I can tell you that I believe that it is probably not exactly the route you want to take.
You see, 302 temporary redirects are typically rendered as being well, temporary. And of course the search engines will recognize this. I do not know the exact effect of this, but I don’t presume it will positively affect your rankings.
Your best bet? Solve the legal issue. I don’t know the legal details, but let me provide a scenario:
I have my site on a domain name called widget.com. Let’s say “Widget” is a trademarked name and obviously I have legal issues there.
What would I do to keep my traffic and cut my losses? Create a new, legal domain name, and use a 301 redirect from widget.com -> LegalWidget.com.
If the legal issues require you to take the site down immediately, and you are just looking for solutions? Well, I would probably stay away from 302 redirects. Instead, I would post a page for the site, that clearly tells my visitors that this site is now called LegalWidget.com, and they can find what their looking for there.
It’s a tough spot your in, don’t take the redirecting methods lightly.
Hope that helps, good luck!
Chris M said,
May 22, 2008 @ 3:58 pm
Thank you for your article. I have a situation that I think requires a 302 temporary redirect. Please give me some advice:
A client of mine has to stop using their current website for 2 years due to a legal matter. In the meantime, they want that URL to be redirected to their new website URL. After the two years are over, they hope to have the other website up and running again.
We do not want to be penalized by the search engines in any way. In this case, what would you do? I have never had to redirect a website before and I want to do it correctly. Thanks!
Chris
Bob Miller said,
March 22, 2008 @ 2:08 pm
What I learned was I will not do it. I’ll just put a link on page until I can get someone to do a server side redirect.
Thanks’
Bob Miller
Brad Montgomery said,
March 7, 2008 @ 2:57 pm
thanks. I’m updating my site now and this article is really helpful.
Thanks for the post.
Brad