Web Hosting How-Tos
  Home arrow Web Hosting How-Tos arrow Page 3 - Hosting a Search Engine Friendly Site
Web Hosting Articles  
Web Hosting FAQs  
Web Hosting How-Tos  
Web Hosting News  
Web Hosting Security  
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
ASP Web Hosting  
ASP.NET Web Hosting 
Budget Hosting 
Coldfusion 
Colocation 
Mobile Linux 
APP Generation ROI 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Reseller Web Hosting 
Shared Hosting 
Small Business Hosting 
Virtual Private Servers 
Windows Web Hosting
 
 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? 
WEB HOSTING HOW-TOS

Hosting a Search Engine Friendly Site
By: Herman Drost
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 5
    2004-12-01

    Table of Contents:
  • Hosting a Search Engine Friendly Site
  • How to implement the 301 Redirect
  • Other ways to implement the 301 redirect:
  • How to design a search engine friendly website
  • Tips 7-12

  • 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


    Hosting a Search Engine Friendly Site - Other ways to implement the 301 redirect:


    (Page 3 of 5 )

    1. To redirect ALL files on your domain use this in your .htaccess file if you are on a Unix Web server:

      redirectMatch 301 ^(.*)$ http://www.domain.com
      redirectMatch permanent ^(.*)$
      http://www.domain.com

      You can also use one of these in your .htaccess file:

      redirect 301 /index.html http://www.domain.com/index.html
      redirect permanent /index.html http://www.domain.com/index.html
      redirectpermanent /index.html http://www.domain.com/index.html


      This will redirect "index.html" to another domain using a 301-Moved permanently redirect.

    2. If you need to redirect http://mysite.com to http://www.mysite.com and you've got mod_rewrite enabled on
      your server you can put this in your .htaccess file:

      Options +FollowSymLinks
      RewriteEngine on
      RewriteBase /
      RewriteRule ^(.*).htm$ $1.html [R=301,L]

      or this:

      RewriteEngine On
      RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
      RewriteRule ^(.*)$
      http://www.domain.com/$1 [R=301,L]

      T
      ip: Use your full URL (ie http://www.domain.com) when obtaining incoming links to your site. Also use your full URL for the internal linking of your site.

    3. If you want to redirect your .htm pages to .php pages and you've got mod_rewrite enabled on your server you can put this in your .htaccess file:

      RewriteEngine on
      RewriteBase /
      RewriteRule (.*).htm$ /$1.php

    4. If you wish to redirect your .html or .htm pages to .shtml pages because you are using Server Side Includes (SSI) add this code to your .htaccess file:

      AddType text/html .shtml
      AddHandler server-parsed .shtml .html .htm
      Options Indexes FollowSymLinks Includes
      DirectoryIndex index.shtml index.html

    Frequently Asked Question:

    What's the difference in using a 301 redirect versus a meta redirect?

    Meta Redirect

    To send someone to a new page (or site) put this in the head of your
    document:

    <meta http-equiv="refresh" content="10;
    url=http://mynewsite.com/">

    Content="10; tells the browser to wait 10 seconds before transfer, choose however long you would like, you can even choose 0 to give a smoother transition, but some (really old) browsers aren't capable of using this so I'd suggest putting a link on that page to your new site for them.

    With a meta redirect the page with the redirect issues a 200 OK status and some other mechanism moves the browser over to the new URL. With a 200 OK on both pages, the search engine wants to index both the start page and the target page - and that is a known spam method (set up 10,000 domains full of keywords for the search engines to index then meta redirect the "real visitor" after 0 or 1 seconds to the "real site" ) so using it gets you penalized.

    The 301 redirect simply issues a Permanently Moved message in the HTTP header which tells the search engine to only index the target URL.

    Conclusion: The safest way to redirect old Web pages to the new pages or old website to the new website and keep the same search engine rankings is to use the 301 redirect. It will also pass on the page rank from your old site to your new site.  

    More Web Hosting How-Tos Articles
    More By Herman Drost


     

    WEB HOSTING HOW-TOS ARTICLES

    - Choosing a Web Host for Your WordPress Blog
    - Connecting to a Server using SSH: the Fundam...
    - How to Expand a Simple Website
    - Practical Virtualization with VirtualBox
    - Other Uses for Your Web Hosting Server
    - Hosting Your Own Website: Reliability
    - Introduction to Hosting Websites
    - Choosing a Website Host
    - How to Choose a Budget Web Host
    - URL Redirection
    - How to Link a Domain Name to a Dynamic IP
    - How to Set up a Simple Website
    - Choosing the Right Kind of Web Hosting
    - Introduction to Choosing the Right Web Host
    - Strategies for Creating Domain Names






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