All hope is not lost - 404 Errors


In a previous article, I ...
the ... of using ...
404 error page on your site and gave ... onhow to create one.
As I ... back then, these pages ...
useful bec In a previous article, I discussed the advantages of using acustomized 404 error page on your site and gave instructions onhow to create one. As I explained back then, these pages arehighly useful because they enable you to benefit from trafficthat would otherwise be lost.
They however do have one dark sidethat can make maintaining your site significantly more difficultthan what it has been before.What is this problem I'm talking about? Well, it is quitesimple. Usually when a server encounters a 404 error, it recordsthe details about the event into its log file.
Should yousuddenly notice that the log shows multiple 404 errors due to apage named "abutme.html" not being found, you can deduct thatyou've probably accidentally linked to "abutme.html" somewhereon your pages instead of using the correct filename"aboutme.html". As you can see from the above, the functionalityoffered by log files makes them a great help in tracking downsuch simple mistakes and enables you to keep your siterelatively free of in-site broken links.However, if you happen to have replaced the standard 404 errorwith your own HTML 404 error page, you can't utilize this usefulfeature.
Yes, you will still see that a 404 error has occurred,but you won't get any further details that would help you figureout what exactly happened. Finding and fixing these errorsbecomes nearly impossible, causing them to pile up over time anddeteriorate the professional image of your site.
Now you'refacing the tough choice of either showing your visitors a veryunfriendly error message that drives them away or accepting thefact that your stylish custom 404 error page will become an alltoo familiar sight to those who click around your site.All hope is not lost====================After reading the above, you must be feeling pretty down. I sureknow I did after having installed my own 404 page only to noticethat I had corrected one problem, but caused another one whiledoing it.
Still, there is a solution to every difficult situationand this one is no exception. If you want to keep your 404 pageand still get informed when you mess things up and create abroken link, you'll be pleased to hear that I happen to have justthe thing for the job.
Before we begin, please take into accountthat in order to use this fix, your host has to be running Apachewith support for .htaccess files, Server Side Includes (SSI) andCGI. Contact your technical support for information on whetheryou have access to these valuable features or not.Without further ado, let's roll up our sleeves and get towork.
The first thing you will need is a CGI script that willlog the errors and let you know about them. There are severalones out there that you can use, but I personally preferMatrix Vault's free 404 Helper that can be found athttp://www.pixelwarehouse.com/cgi/404helper.shtml .
Downloadthe source code to your hard drive and open it in a text editor.You can get free editors from the Net, but the old MS-DOS Editsupplied with just about every version of Windows will do justfine. To run Edit, go to Start, Run, type "edit" without thequotes into the box and click OK.Before you start editing the file, you'll need to know where yourhost has installed the Perl interpreter and Sendmail.
Once youhave figured it out, check if the paths used in the CGI scriptmatch those your host uses. The Perl interpreter's location isset to /usr/bin/perl in the first row and the location ofSendmail is set to /usr/lib/sendmail in the 21st row.
Makechanges, if necessary.After you have made sure that the paths are correct, modify therest of the script to suit your needs. Be sure to replace theE-mail address in the $email field with the one you want theerror report to be sent to.
You might also wish to use a smallervalue in the $mailon field than the default of 10, as it cantake quite a while for a small site to generate enough 404errors to fill up a 10K log. I suggest using a value of 1 or 2 atthe beginning and raising it later if you feel that you arereceiving the error reports more often than you'd like to.You're now done with the CGI script.
Save it as "404helper.cgi",without the quotes of course. However, there's still work to bedone, so take a deep breath and prepare yourself for the nextchallenge.Editing your custom 404 page and .htaccess file===============================================Just having the script will not be enough.
In order for it towork, it has to be executed when an error is encountered. This isthe part where the SSI's step into the picture.
Open up your 404error page in a text editor and add the following line into it:Because the script prints out a few rows of HTML after it hasbeen run, the best place for that line is at the bottom of your404 error page, but before the tag. After everything issafely in place, simply save the file, but instead of ending itwith the usual ".htm" or ".html", use ".shtml".
Do not forget todo this, as the SSI tag might not work if you fail to use theproper extension.Finally, you will have to edit the .htaccess file you createdwhen you built your custom 404 page. If you only have" ErrorDocument 404 http://www.yourdomain.com/404page.html "in it, modify the file so that it will contain the following:Options Includes ExecCGIAddType application/x-httpd-cgi .cgi .plAddType text/html .shtmlAddHandler server-parsed .shtmlErrorDocument 404 http://www.yourdomain.com/404page.shtmlThe new lines will enable Server Side Includes and CGI so thatyour script will work.
Do not forget to change the ErrorDocument404 line to point to the new .shtml page instead of your old.html version. After you are done, save your .htaccess file.Upload, set permissions and launch!===================================Connect to your host with an FTP program and upload the .shtmlversion of your 404 page and your new .htaccess file into yourroot directory.
Then go to the directory you've reserved for CGIprograms and send the 404helper.cgi file there. Make sure thatyou upload in ASCII, not in Binary mode! I nearly drove myselfcrazy by accidentally using Binary mode and then trying to figureout why the script refused to work.Everything is now uploaded and all that remains is to setpermissions so that the CGI program can be executed.
You'll needto CHMOD 755 both the CGI file and the directory where it is in.The steps you need to take in order to accomplish this depend onwhat software you are using, but here are the instructions onhow to do so with WS_FTP, a popular Windows FTP program which canbe downloaded from Tucows.com.First, navigate to the directory where you've uploaded the CGIprogram. Left-click it once to highlight the file, then right-click it.
Select "chmod (Unix)" from the menu that appears. GiveRead, Write and Execute permissions to the Owner and Read andExecute permissions to Group and Other.
Then go into the rootdirectory and repeat the same process with the folder of thedirectory where you placed the CGI program.That's it. The work is finally done and you can now enjoy theluxury of receiving an E-mail report on all 404 errors, allowingyou to quickly stomp out any broken links and improve thequality of your site.
Congratulations! Article Tags: Error Page Source: Free Articles from ArticlesFactory.com .

Top blog stories

A review of Idmobile.com

Idmobile.com offers both pay-as-you-go and contract plans. Pay-as-you-go plans are ideal for customers who don't want to be tied down to a long-term contract, and they can purchase bundles of data, minutes, and texts as and when they need them.

see post

A review of Idmobile.com

Idmobile.com offers both pay-as-you-go and contract plans. Pay-as-you-go plans are ideal for customers who don't want to be tied down to a long-term contract, and they can purchase bundles of data, minutes, and texts as and when they need them.

see post

AO.co: Online Shopping Made Simple

AO.co is a trusted expert in TVs, washing machines, clothes dryers and other household appliances. AO.com is one of the largest retailers in the UK and it specializes in electronics, clothes and home furniture.

see post

For our people.

At Three, we believe phones are good. They just make life better. Easier. And more fun. But we all need to find a balance that works for us. Our mission is to help our customers use their phones to live their best lives.

see post

We make your life easier

We make your life easier Since 1992, we’ve been helping customers get the best deal on their dream phone. We firmly believe in giving you the highest quality, for the lowest price. That’s why we work with three of the UK’s leading networks to do all the haggling for you,...

see post

FOUR BRANDS BECOME ONE. CURRYS.

Currys PLC is a leading omnichannel retailer of technology products and services, operating through 800+ stores and 16 websites in seven countries.

see post

Halfords - Quicker, Easier, and Convenient.

At Halfords, we're all about the journey. With more than 700 stores with over 10,000 colleagues, we're the UK's leading retailer of automotive and cycling products. We are also the leading operator in MOT, tyres, car servicing and car repairs - pleasing more than 750,000 customers every year.

see post

FOUR BRANDS BECOME ONE. CURRYS.

Currys PLC is a leading omnichannel retailer of technology products and services, operating through 800+ stores and 16 websites in seven countries.

see post

Sky - Epic. Endless. Entertainment.

It's important to us that everyone gets great customer service and can enjoy our products, no matter their level of sight. So, if you're blind, partially sighted or struggle to see or read the screen, we’ve a range of features to help you get the most from our products and...

see post

Nasty Gal - We exist for the “girl in progress”.

Look iconic, without the hassle— using Nasty Gal discount codes, you can shop your favorite pieces for way less by simply entering one of our promotional codes (of your choice) at the checkout. From delivery offers, to promo deals, we keep ‘em coming, so you always have the offer you...

see post

Digital Publishing From Past to Now

The Covid-19 has caused the school and universities to shut down around the world creating a major issue in Learning and Education. As this virus spreads through the interaction and if social distanci... The Covid-19 has caused the school and universities to shut down around the world creating a major...

see post

Why it’s Important to Manage Your Holiday Calendars?

A printable calendar 2021 is a prominent online platform where you download printable calendars of your choice. These calendars can be customized as per our client requirement with photo, text, logo, or any other image. If you are thinking of planning a dream vacation tour with family and kids but...

see post

A review of Idmobile.com


Idmobile.com offers both pay-as-you-go and contract plans. Pay-as-you-go plans are ideal for customers who don't want to be tied down to a long-term contract, and they can purchase bundles of data, minutes, and texts as and when they need them.

A review of Idmobile.com


Idmobile.com offers both pay-as-you-go and contract plans. Pay-as-you-go plans are ideal for customers who don't want to be tied down to a long-term contract, and they can purchase bundles of data, minutes, and texts as and when they need them.

AO.co: Online Shopping Made Simple


AO.co is a trusted expert in TVs, washing machines, clothes dryers and other household appliances. AO.com is one of the largest retailers in the UK and it specializes in electronics, clothes and home furniture.

For our people.


At Three, we believe phones are good. They just make life better. Easier. And more fun. But we all need to find a balance that works for us. Our mission is to help our customers use their phones to live their best lives.

We make your life easier


We make your life easier Since 1992, we’ve been helping customers get the best deal on their dream phone. We firmly believe in giving you the highest quality, for the lowest price. That’s why we work with three of the UK’s leading networks to do all the haggling for you,...

FOUR BRANDS BECOME ONE. CURRYS.


Currys PLC is a leading omnichannel retailer of technology products and services, operating through 800+ stores and 16 websites in seven countries.

Halfords - Quicker, Easier, and Convenient.


At Halfords, we're all about the journey. With more than 700 stores with over 10,000 colleagues, we're the UK's leading retailer of automotive and cycling products. We are also the leading operator in MOT, tyres, car servicing and car repairs - pleasing more than 750,000 customers every year.

FOUR BRANDS BECOME ONE. CURRYS.


Currys PLC is a leading omnichannel retailer of technology products and services, operating through 800+ stores and 16 websites in seven countries.

Sky - Epic. Endless. Entertainment.


It's important to us that everyone gets great customer service and can enjoy our products, no matter their level of sight. So, if you're blind, partially sighted or struggle to see or read the screen, we’ve a range of features to help you get the most from our products and...

Nasty Gal - We exist for the “girl in progress”.


Look iconic, without the hassle— using Nasty Gal discount codes, you can shop your favorite pieces for way less by simply entering one of our promotional codes (of your choice) at the checkout. From delivery offers, to promo deals, we keep ‘em coming, so you always have the offer you...

Search topic

Nasty Gal - We exist for the “girl in progress”.

Look iconic, without the hassle— using Nasty Gal discount codes, you can shop your favorite pieces for way less by simply entering one of our promotional codes (of your choice) at the checkout. From delivery offers, to promo deals, we keep ‘em coming, so you always have the offer you...

Learn more