101 Web Template

VIEW CART : CHECKOUT
SUPPORT

REGISTER TODAY!
SIGN IN

Top Site Resources Site Map

Business Web Templates : PayPal Web Templates : Portal Web Templates : Misc. Web Templates

Portal Web Template 019
$29.99

  1. Portal Web Template 018
  2. PayPal Web Template 001
  3. Business Web Template 036
  4. Portal Web Template 008
  5. Business Web Template 052

FAQs

Support

Terms of Use

Advanced Search

Template RSS Feed

Top » 101 Web Template » Client Side Coding » Renaming/moving a page? 301 redirect it!

Website Templates : Web Templates : Photoshop Templates

101 Web Template - Your Template Solution

Renaming/moving a page? 301 redirect it!

Renaming/moving a page? 301 redirect it!

If you are considering moving a page on your web site into another folder or simply renaming it; there's a couple of important points to consider. The most important issue is that if the page you are moving or renaming has a good search engine ranking already, or may have been bookmarked by your visitors; all your hard work could be lost.

Bearing in mind that search engines can take months to refresh their listings, any visitor clicking on a search engine result may be severely frustrated if they don't arrive on the page on your site. You could always use a custom 404 error page; but this is still an extra hurdle for visitors to jump and the rankings you have built up for the page in question will be lost.

Wouldn't it be great if you could set up your site so it was "smart" enough to know that the page had been renamed or moved and then take the visitor to the correct page? Well, you can!

Enter the 301 redirect

One of the simplest ways to redirect visitors is to put up a blank page with what's known as a "meta-refresh" tag, but, this is frowned upon by many search engines and definitely won't save your rankings, so we won't discuss it any further. If you are currently using meta-refresh tags, it would be wise to consider changing them over to a 301 redirect as it is the most efficient and friendly solution. Search engine spiders and human visitors will be presented with the correct page if the old page is requested - seamlessly.

A 301 redirect is implemented in your .htaccess file.

What is .htaccess ?

.htaccess is a text file that is checked by the web server when a request for a page/item is made by a browser, agent or spider. It contains specific instructions on how to handle specific requests and also plays a role in security.

What's a 301 redirect?

"301" translates to "moved permanently". After the code, the name and location of the moved or renamed page is noted, then there is a space, and then the new location and name of the file.

Implementing a 301

First of all, check with your web host that you can use a 301 redirect - not all web servers will be compatible.

You'll then need to download the .htaccess file from your web site which can be found in the root of your documents directory via ftp (use ASCII mode). If a .htacess file isn't present, create one with Notepad or a similar text editor. Ensure you remember the "." at the beginning of the file name and do not use a tail extension

If there is a .htaccess file already in existence with lines of code present, be very careful not to change any existing code. It's probably wise to create a backup of this file in case you make a mistake.

Scroll down to the end of the current code, miss a line and then create a new line using the following example as a guide.

redirect 301 /current/currentname.htm http://www.you.com/newfolder/newname.htm

That's all there is to it - save and upload back to the document root directory and then test it out by typing the old address into your browser - you should be seamlessly redirected to the new page name/location.

Note: Do not use "http://www" in the first section of the statement - just add the path from the top level of your site to the page. Also ensure that you leave a single space between these elements:

redirect 301 (the directive that the page has permanently moved)

/currentfolder/currentname.htm (the old path and file name)

http://www.you.com/newfolder/newname.htm (new path and file name)

Moving/renaming many pages?

The basic 301 redirect is a great solution for changes to a few pages, but what about dozens of pages or an entire site? A more powerful set of instructions for URL redirects is contained in the Apache mod_rewrite module. Learn more about it here:

http://httpd.apache.org/ docs/misc/rewriteguide.html

Michael Bloch
Team ThinkHost
http://www.thinkhost.com

ThinkHost is an international web hosting company offering reliable and well supported FrontPage, PHP and MySQL hosting services, plus a wide range of related resources for their clients. This article is copyright (C) 2003 and cannot be reproduced without express written permission from ThinkHost.

Affiliate Programs

Getting Started

Design and Layout

Client Side Coding

Server Side Coding

eCommerce

Marketing

All Webmaster Articles

Free PayPal Template

Webmaster Resources

101 Web Template RSS Feed

Free Templates

Templates Box

Free Web Templates

4 Layouts

Template Monster

Template Blog

Web Hosting Directory

Business : PayPal : Portal : Misc.
Support : Webmaster Resources : Top Site : Articles : Site Map : Web Hosting

© 2002-2010 101 Web Template, All Rights Reserved.
Designed by Graphic Web Design | Hosting by Las Vegas Web Hosting