Building BobSmithPhotography.net has stopped expanding because I've been overwhelmed with spam on the comment forums. So, if you're here and have questions about web design come and visit Forums, Blogs, Wikis dot com. It has articles that I've written, some of which are also here, and a web design forum as well so you can ask any questions you may have. There is still a lot of good stuff here though, so poke around the links and take a look.

Home » Glossary » 301

301 Redirect

A 301 redirect is a special piece of code that tells web browsers (and robots) that a file has moved and then passes the new location.   The browser automatically follows the redirection to the new location.

You would use a 301 redirect when you move a page but have external links pointing to that page or that page is indexed in a search engine. Eventually the search engine will pick up the different link.

You can also use a 301 redirect to force either a www or non-www scheme on your site.  With the code below, if someone goes to bobs-site.com it will automatically send them to www.bobs-site.com. The code below goes in your .htaccess file.  Be careful if you're using FrontPage as changes to the .htaccess file can cause problems.

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

If you are only temporarily moving a file, you can use a 302 redirect instead.  

Content managed by the Etomite Content Management System.