Forum Moderators: DixonJones

Message Too Old, No Replies

How to Create 301 error page?

         

itrainu

11:30 am on Sep 19, 2002 (gmt 0)

10+ Year Member



Somewhere in here recently I read about creating a 301 error page which would redirect visitors to the new URL which contains the content they seek.

When I go into the control panel that my ISP provides, there is an opportunity to create error pages as follows: 400, 401, 403, 404, 500...but no 301.

I can likely ask them (they are quite good this way) to provide that option... or is there a way that I can do this myself?

Thanks!

So much to learn here *agh*

itrainu

mack

11:39 am on Sep 19, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



301 uses a file called .htaccess

it is a file that is stored in your root directory (where you place your homepage) and it can be used to redirect hits from one page to another or one directory to another.

I am no .htaccess expert you could maybee try a search on this site for "htaccess redirection"

Hope this is of some help.

added
the 404 error page is always good to have because that way when ever one of your users find him/her self off the beaten track and tries to access a page that no longer exists they will be displayed one of your pages as oposed to the browser "page not found " default error page.

On the 404 you could have a site search box or a site map or even just a link back to your homepage.

The Toecutter

2:23 pm on Oct 1, 2002 (gmt 0)

10+ Year Member



Mack is correct. You can also make custom 404 page error redirects here too! (Delete line 2 below if you don't want to do that) Here's how I did it:

1) Create a file in Notepad called htaccess.txt and store it in same directory on your hard drive as your index.html file.
2) put lines like these in it:

Send a permanent redirect from our old files to our new files and to handle 404 Errors
errorDocument 404 /page-not-found.html
Redirect permanent /old-missing-page-1.html [your-url.com...]
Redirect permanent /old-missing-page-2.html [your-url.com...]

3) save the file to your hard drive
4) upload to your root directory on your host server.
5) rename the file to ".htaccess" (without the quotes)
6) test it to make sure it works!

itrainu

11:03 am on Oct 3, 2002 (gmt 0)

10+ Year Member



Thanks Toecutter and Mack!

I really look forward to trying this out!

I picked up a client who has a "double version" website - Canada or US - but they appear identical to me! And page names are really bad...and there are *alot* of sites which link to these pages, so these error solutions will come in handy!

itrainu