Search Optimization
  Home arrow Search Optimization arrow Page 3 - Preparing Your New Site for Structural...
SEO Chat Forums  
Choosing Keywords  
Google Optimization  
Link Trading  
MSN Optimization  
Search Engine News  
Search Engine Spiders  
Search Optimization  
Web Directories  
Website Marketing  
Website Promotion  
Website Submission  
Yahoo Optimization  
SEO Tools
Adsense Calculator
AdSense Preview
Advanced Meta-Tags
Alexa Rank Tool
Check Server Headers
Class C Checker
Code to Text Ratio
CPM Calculator
Domain Age Check
Domain Typos
Future PageRank
Google Dance
Google Keywords
Google Search
Google Suggest
Google vs Yahoo
Indexed Pages
Keyword Cloud
Keyword Density
Keyword Difficulty
Keyword Optimizer
Keyword Position
Keyword Typos
Link Popularity
Link Price Calculator
Meta Analyzer
Meta Tag Generator
Multiple Link Popularity
Page Comparison
Page Size
PageRank Lookup
PageRank Search
Robots.txt Generator
ROI Calculator 
S.E. Comparison 
S.E. Keyword Position 
Site Link Analyzer 
Spider Simulator 
URL Redirect Check 
URL Rewriting 
Mobile Linux 
APP Generation ROI 
IBM® developerWorks 
SEO Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
SEARCH OPTIMIZATION

Preparing Your New Site for Structural Changes
By: Bill Sterzenbach
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 13
    2004-02-25

    Table of Contents:
  • Preparing Your New Site for Structural Changes
  • The Solution
  • Improper Redirect: Simple Redirection Header
  • Proper Redirect - Redirection with 301 Code
  • Moving Pages
  • The Code

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Preparing Your New Site for Structural Changes - Improper Redirect: Simple Redirection Header


    (Page 3 of 6 )

    When the new system has determined that it can successfully intervene on the visitors’ behalf, it must redirect the visitor (or spider) to the appropriate content. There are a few ways this can be done. We are going to use a location header (php) and a HTTP status code in this article. To get started, let's look at what happens when we create a redirect on a page. Take a look at the following code:

    <?
    //redirect.php
    header("Location: http://www.example.com/");
    ?>

    This snippet of code will automatically redirect the visitor to http://www.example.com. This is done by setting a 302 header.

    To FULLY understand this, we must take a look at the actual text being passed back and forth in the background. I suggest for anyone who wants to better understand the nuts and bolts of the HTTP underpinnings, pick up a free copy of ethereal. Ethereal is a packet sniffing (er..network protocol analyzer) application that will let you see every packet that passes over the wire for each request. Ethereal can also be very helpful when troubleshooting cookies and other headers being passed back and forth.

    Here is a snippet from the actual exchange that took place when I requested http://www.hafenbrack.com/redirect.php

    GET /redirect.php HTTP/1.1\r\n
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*\r\n
    Accept-Language: en-us\r\n
    Accept-Encoding: gzip, deflate\r\n
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n
    Host:
    www.hafenbrack.com\r\n
    Connection: Keep-Alive\r\n
    Cookie: ClickTrack=1.1.1.1.14477107221282637\r\n
    \r\n

    You can see that my browser requested the file /redirect.php and passed a few headers to the server. The line we are interested in here is the GET line. It shows the file originally requested.

    Now, let's take a look at how the server responded.

    Below is a snippet from the actual exchange that took place when the server fulfilled my request for /redirect.php

    HTTP/1.1 302 Found\r\n
    Date: Tue, 23 Dec 2003 20:53:46 GMT\r\n
    Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_jk/1.2.0 mod_perl/1.26 PHP/4.2.2 FrontPage/5.0.2 mod_ssl/2.8.12 OpenSSL/0.9.6b\r\n
    Set-Cookie: ClickTrack=1.1.1.1.14477107221282637; path=/; expires=Tue, 23-Dec-03 21:53:46 GMT\r\n
    X-Powered-By: PHP/4.2.2\r\n
    Location:
    http://www.example.com/\r\n
    Keep-Alive: timeout=15, max=100\r\n
    Connection: Keep-Alive\r\n
    Transfer-Encoding: chunked\r\n
    Content-Type: text/html\r\n
    \r\n

    Do you see what happened here? The server received the request, passed back a header with a status code of Found 302 (moved temporarily). While this would work fine for browsers, this is not really what we want in our case, as we want to tell search engine spiders that the content has moved PERMANENTLY to a new location. To do this, we must employ the 301 header response code.
     

    More Search Optimization Articles
    More By Bill Sterzenbach


     

    SEARCH OPTIMIZATION ARTICLES

    - Implementing Six Sigma Methodology for SEO
    - Introducing Six Sigma Methodology for SEO
    - What is Mobile SEO?
    - Using Lynx for SEO Analysis
    - Mastering Lynx (Open Source Text Browser) fo...
    - More Blogging Tips: Cooking with Gas
    - Blogging Tips from Julie and Julia
    - SEO Essentials: the Proper Web Server and Pl...
    - Steps to Higher Rankings and Traffic
    - Building Linkable Pieces and Titles
    - Page Rank Sculpting
    - Page Rank Optimization
    - ClickTale Review
    - Final Issues: Moving Blogger to WordPress wi...
    - Avoid the Mistakes New SEOs Make



     



    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek