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

Client-side

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).

Server-side

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.

20 Responses to “Understanding Web Page Redirection, the smart way”

Pages: [2] 1 » Show All

  1. Daniel Bely said,

    April 9, 2009 @ 6:13 pm

    Very nice and helpful article. Thanks!

  2. 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

  3. 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)

  4. 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

  5. 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?

  6. 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

  7. 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]

  8. 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]

  9. Paul said,

    December 19, 2008 @ 2:01 am

    What should one do if they do not have server side abilities like .htaccess, php etc.?

  10. 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.

Pages: [2] 1 » Show All

Leave a Reply