HTMLGoodies
The ultimate html resource
Earthweb.com


About the Double-Underlined Links


Become a Partner




Search Clipart.com:



internet.commerce















HTML Goodies : Beyond HTML : Reference Pieces: So You Want a 404 Error Page, Huh?

HTML GOODIES TO GO NEWSLETTER


Other Related Newsletters

So You Want a 404 Error Page, Huh?


By Joe Burns

Use these to jump around or read it all...
[You'd Best Ask First]
[Your .htaccess File]
[Let's Edit It!]

     Ah, the aggravating 404 error page. You've seen it. There you are, surfing in your favorite search engine when you happen upon just the thing you're looking for. You click: (***Raspberry Sound Effect***) Nothing but a white page with the words "404 Error" and some other techie-sounding speak beneath.
     What's even more cheesy about the error code is that it really doesn't tell you what the problem is. Basically you've been informed that the server cannot find what you want. It doesn't tell you why, how to fix it, or where to go from that point. You really don't have much choice but to hit your BACK button, call the computer a dirty name, and try again.

     But then you see it--a server that's set up with its own special 404 error page that politely apologizes and offers you links to e-mail site administrators and maybe a site search engine. Now that's class! So I waltzed into the office of the Webmaster at work and asked how it was done. I was stunned at how easy it is to set up.
     Want one of your own? Here's how.


You'd Best Ask First

     I'm going to offer you a very basic fix to this problem, but you'd best ask your system people if they want you doing this first. Better yet, ask them if you might mess things up by doing this.


Your .htaccess File

     This is the file that will do the trick for you. You should already have one waiting inside of your Web site directory. If you don't, then you'll need to create it.

     FTP into your server so you're looking at the top level directory where you store your Web page files. This should be the directory that contains your home page document. Look for the .htaccess file there. Again, if you don't find it (it should be one of the very first files), then you'll need to create it.
     Please notice the dot (.) starting it off.

     Here again is where you might have to get in touch with your systems people and ask them how they want you to edit or create this file. Some may allow you to do it like you would any other Web page, by creating a text document and uploading it, while others might want you to use a PICO editor and do it right on the server. It might be best not to guess at it.


Let's Edit It

     Add this to the .htaccess file:

ErrorDocument 404 http://www.domain.com/404page.html

     That's it. Just that line. (Yes, it should all be on one line--some smaller computer screens may bump it down to two--get it all on one.) Where I have http://www.domain.com/404page.html is where you place the full URL pointing to that new, fancy 404 Error page you've created.
     ...you have already created an error page, right?


Let's Turn It On

     If you already had an .htaccess page in your directory then chances are it's already turned on. If not, you need to do that. If you're using a UNIX server then you'll need to telnet into the server and type this command at the prompt:

chmod 644 .htaccess

     If you're not running a UNIX machine, I believe the file is ready to go, but again, contact your server people to see if I'm on the money or not.

That's It!

     Upload your new 404 error page, if you haven't already, and log into your site. Then try to go to a page that doesn't exist. You should get the page you denoted in the .htaccess file. If you don't, first check to see if the file is turned on by trying the CHMOD again. If you still get nothing, then get back in touch with your system people and ask them for more specific help.
     You'll be the envy of people who go to non-existent pages everywhere.

 

Enjoy!

 

[You'd Best Ask First]
[Your .htaccess File]
[Let's Edit It!]

 

Tools:
Add htmlgoodies.com to your favorites
Add htmlgoodies.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed

IT Management Networking & Communications Web Development Hardware & Systems Software Development Earthwebnews.com



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM Whitepaper: Service Component Architecture Enabling XML Web Services for Java Programmers
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Intel Article: Using Power & Display Context in the Intel Mobile Platform SDK
Internet.com eBook: Real Life Rails
IBM SCA Center Article: Simplifying Composite Applications with Service Component Architecture
Intel PDF: Quad-Core Impacts More Than the Data Center
Internet.com eBook: The Pros and Cons of Outsourcing
Go Parallel Article: Scalable Parallelism with Intel(R) Threading Building Blocks
Intel PDF: Analysis of Early Testing of Intel vPro in Large IT Departments
Internet.com eBook: Best Practices for Developing a Web Site
Intel PDF: IT Agility through Automated, Policy-based Virtual Infrastructure
IBM CIO Whitepaper: The New Information Agenda. Do You Have One?
Microsoft Article: BitLocker Brings Encryption to Windows Server 2008
IBM Whitepaper: Service Component Architecture & Java EE Integration
Microsoft Article: RODCs Transform Branch Office Security
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
Avaya Article: Advancing the State of the Art in Customer Service
IBM Whitepaper: How are other CIOs driving growth?
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Avaya Article: Avaya AE Services Provide Rapid Telephony Integration with Facebook
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Go Parallel Video: Intel(R) Threading Building Blocks: A New Method for Threading in C++
HP Video: Is Your Data Center Ready for a Real World Disaster?
HP On Demand Webcast: Virtualization in Action
Go Parallel Video: Performance and Threading Tools for Game Developers
Rackspace Hosting Center: Customer Videos
Intel vPro Developer Virtual Bootcamp
HP Disaster-Proof Solutions eSeminar
HP On Demand Webcast: Discover the Benefits of Virtualization
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Download: IBM WebSphere Application Server V7.0 Feature Pack for Service Component Architecture
Actuate Download: Free Visual Report Development Tool
Microsoft Download: Silverlight 2 Software Development Kit Beta 2
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt
IBM SCA Download: Start Building SCA Applications Today
Iron Speed Designer Application Generator
Microsoft Download: Silverlight 2 Beta 2 Runtime
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
IBM IT Innovation Article: Green Servers Provide a Competitive Advantage
Microsoft Article: Expression Web 2 for PHP Developers--Simplify Your PHP Applications
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES