by   December 02 2015   
How many times do you search your web logs to find all your error pages with the hope of fixing the page errors from 404 to 500? If you're like me, you have been using a script to email you when it happens so you can correct the issue quickly. Who wants to find out a page wasn't found for 30 days when you can find out the page wasn't found on the first hit. Good SEO work never ends and monitoring in real time your page response codes doesn't have to be as hard as you might think.

You should know your Page Status Alerts:

Many that practice great SEO sometimes miss the most troubling part of managing large websites. The dreaded 404 pages that we all will sooner or later experience. 

I have scripts in my site that are designed to send me notices when a page error has been detected or a login attempt failed and when a page wasn't found. 

I used to review logs but found it was more time consuming. 

So now I have a simple script that sends me an email with just enough information collected from the issue to find and fix the problem if there is one. 

 

 

Here's a copy of what I get via SMTP. 

Subject of email: [404 500 ALERT MODULE FUNC_XCTMv10 ]
IP: 123.123.123.123
================== MESSAGE BELOW =====================
ERROR TAG STRING: 404;http://yourdomain.com:80/sitemap_33.xml
LINK: http://yourdomain.com/404page.asp
400 = 0 No
401 = 0 No
403 = 0 No
404 = 1 Yes
500 = 0 No
SCRIPT_NAME: /404page.asp
SCRIPT_HOST www.yourdomain.com
SiteTrack:
HTTP_REFERER:
REMOTE_HOST: 123.123.123.123

================== END MESSAGE =====================

 

The script fires on any of the 400 and 500 errors www sites get. 
When I see the Error Tag String is a good page but not being found I check it. 
In this case, MSN Search Bot found a missing stiemap_33.xml which I haven't used that format in 2 years. So I leave it, let them update their Bing index. 

Details:
I run IIS 7 WWW servers and have custom error pages that all errors (when it works perfect) are redirected to. The Error Number is attached to my querystring so I can simply look for 404; and identify that the referral is from a Page Not Found. The querystring also contains the page in question.

I program in ASP Classic and .Net so you'll have to do your own PHP work. If you do have something like this I can add your code if you send it to me.

If InStr(1,LCase(strLPC_Query),LCase("400;"),1) <> 0 _
OR InStr(1,LCase(strLPC_Query),LCase("401;"),1) <> 0 _
OR InStr(1,LCase(strLPC_Query),LCase("403;"),1) <> 0 _
OR InStr(1,LCase(strLPC_Query),LCase("404;"),1) <> 0 _
OR InStr(1,LCase(strLPC_Query),LCase("500;"),1) <> 0 _
Then
strTestSubject = "[404 500 ALERT MODULE FUNC_XCTMv10 ]"
strTestBody = "IP: "&sipDotIP&""
strTestBody = strTestBody & vbcrlf & "================== MESSAGE BELOW ====================="
strTestBody = strTestBody & vbcrlf & "ERROR TAG STRING: "&strLPC_Query&""
strTestBody = strTestBody & vbcrlf & "LINK: "&strLinkPoisonRedirectPage&""
strTestBody = strTestBody & vbcrlf & "400 = "&InStr(1,LCase(strLPC_Query),LCase("400;"),1)&""
strTestBody = strTestBody & vbcrlf & "401 = "&InStr(1,LCase(strLPC_Query),LCase("401;"),1)&""
strTestBody = strTestBody & vbcrlf & "403 = "&InStr(1,LCase(strLPC_Query),LCase("403;"),1)&""
strTestBody = strTestBody & vbcrlf & "404 = "&InStr(1,LCase(strLPC_Query),LCase("404;"),1)&""
strTestBody = strTestBody & vbcrlf & "500 = "&InStr(1,LCase(strLPC_Query),LCase("500;"),1)&""
strTestBody = strTestBody & vbcrlf & "SCRIPT_NAME: "&strLPC_ScriptName&""
strTestBody = strTestBody & vbcrlf & "SCRIPT_HOST "&strLPC_Host&""
strTestBody = strTestBody & vbcrlf & "SiteTrack: "&strWhatSiteTrack&""
strTestBody = strTestBody & vbcrlf & "HTTP_REFERER: "&strLPC_Ref&""
strTestBody = strTestBody & vbcrlf & "REMOTE_HOST: "&strLPC_RemHost&""
strTestBody = strTestBody & vbcrlf & ""
strTestBody = strTestBody & vbcrlf & "================== END MESSAGE ====================="
Call SendEmail(strMe,strYou,strTestSubject,strTestBody)
End If

You can monitor the status codes as well.

The above code is the email alert code I use.
If you don't have custom error pages setup you should, it's SEO friendly that way and you don't lose as many visitor due to page errors. From within your error page you fire off this script.

I am not going to add my script because ASP Classic is old and you should know how to include your page status to a simple querystring that can be read as a query to run your script easy. 

Just thought I would share how I keep up with thousands of pages one page at a time. 

Murray

 

 

How many times do you search your web logs to find all your error pages with the hope of fixing the page errors from 404 to 500? If you're like me, you have been using a script to email you when it happens so you can correct the issue quickly. Who wants to find out a page wasn't found for 30 days when you can find out the page wasn't found on the first hit. Good SEO work never ends and monitoring in real time your page response codes doesn't have to be as hard as you might think.