Specifying Error Pages

  • Thread starter Thread starter Canu
  • Start date Start date
C

Canu

Hi,

I've recently taken over a website and would like to know
if is possible to specify a premade "error" page when
someone enters the URL of a page that doesn't exist in
the website so for example:

www.anysite.com/questons.html wouldn't exist so it would
point to www.anysite.com/pagenotfound.html as the default
page for non existent pages.


Any and all help would be appreicated.


Thanks
 
It depends on whether your host allows it.
They are called custom error pages and the file name for the page is the same as the error number,
and they use the smart html extension. ( on an Apache?UNIX server anyway )
Example 404.shtml 401.shtml

Here's an example: http://www.95isalive.com/404.shtml

clicking http://www.95isalive.com/xzz.html will return the same page.

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
Howdy.

Yes, this is possible, but it usually requires
configuration of settings on the Web server.

Typically, you would make up a simple error page, and then
tell your host under what conditions (i.e. under what
status codes) to you want the Web server to display it. If
the host agrees and the page seems to be working, then you
can spruce it up.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
on Unix/Linux it is the '.htaccess' function (search on google for 'htaccess').

On Windows, I don't know the equivalent.....it would be nice to produce error
pages that match the look of the site.
 
Also it's enabled via the web masters CPanel control panel. Then edit the pages in FrontPage.

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
On windows servers your host needs to enable this feature. Any host worth
their salt should do so then you can set a custom error page to match your
site and also do something useful with the error - eg email it to you log it
to a database etc.

If you use asp.net you can enable it yourself by editing web.config but this
will only work non existant pages that are parsed by asp.net eg
nosuchpage.aspx would trigger the custom 404 defined in web.config
nosuchpage.htm would not. It's still better to set the custom 404 through
IIS

Tip - by logging 404s to a database you can also find out how many IE users
add you to their favourites by checking 404s for favicon.ico (when a user
adds to favourites in IE a 404 for favicon.ico will be logged) this gives a
very useful measure of how popular your site is.
 
If you specify the custom error page in .htaccess, they don't have to be
named by the error number and they don't have to have the .shtml
extension --

in the .htaccess file:
ErrorDocument 404 /error.htm

you can add additional entries for other error numbers if you wish and
send all to the generic error page:

see http://www.psychlinks.ca/error.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top