Graphic/Web Design Blog


A great resource for web and graphic design for beginner and advanced designers. Learn about Adobe Software, XHTML, CSS and PHP coding, Design Jargon and other resources to help you.

Posts Tagged ‘Error 301’

Redirecting Pages using .htaccess

Sunday, June 1st, 2008

This quick post explains how to redirect users to different pages on your website and in theory, not harm your Google Page Rank. Basically using the 301 error code tells a search engine or browser that the file was once there, and it has permanently moved.

Error 3o1: Permanently Moved should not be confused with the more frequently seen Error 404: Page Not Found. This error code is generally used to indicate that content does not exist anymore. Error 404’s will eventually filter out of search engines over time.

Note: It is assumed you have a general understanding of how to make/edit a .htaccess file.

To relocate one page use this snippet:

Redirect 301 /oldpage.php http://www.yoursite.com/newpage.php

You can add as many of these lines to your .htaccess file as needed. However, if you would rather just move all 301 errors to your main page (or any page for that matter), use this snippet of code:

Redirect 301 / http://www.yoursite.com

There are many other ways to handle a redirect, but this way I find is the easiest and requires the least amount of coding.

Rate this Press Release