The problem I've had setting up a global 404 handler is that I can setup a front end friendly error page easily enough, but the method used to set it up hugely affects my ability to actually report what the error was.
For example in the Linux admin area I can specify a path to a 404 template, but this appears to actually relocate the user to the file specified, leaving any error and its associated information behind.
Similarly the 'onMissingTemplate' Application.cfc function only fires when a missing ColdFusion template is requested. Not just any old url that someone tries on my site.
What I eventually ended out with is a URL rewrite rule that catches any page request that does not match an already defined re-write rule.
So if a user asks for 'www.mysite.com/contact/' the following rule would be found and used:
RewriteRule ^/contact/$ index.cfm?go=contact
But if they asked for any non matched rule, for example 'www.mysite.com/contactx/', or 'www.mysite.com/hack-attempt/' then the following rules would kick in and divert the user:
RewriteRule ^([^/.]+)/$ index.cfm?go=error&error=$1
RewriteRule ^([^/.]+)$ index.cfm?go=error&error=$1
# Error handlers
The rule above just sends a user to my error page. It also appends the string matched in the Regular Expression to the end of the URL (error=$1).
This is so I can pick it up in a ColdFusion variable scope and log it, to actually let me know what the error was.
There is another documented way of using URL re-writing to redirect users to custom error pages. You can use custom error pages for any error type as long as you know its number by adding the following to your re-write file:
ErrorDocument errorNumber path/file.htm
As an example if I had the file 'error.htm' in the root directory of my site and I wanted to use it for a 404 error I would use:
ErrorDocument 404 /error.htm
Some of the more common server error responses are:
400 - Bad request
403 - Forbidden
404 - Wrong page
500 - Internal Server Error
401 - Authorization Required
I was recently approached by Packt Publishing to review one of their new books, CMS Design using PHP and JQuery. They mentioned that I'm always talking about JQuery so thought I'd be an ideal test subject.
I've dabbled in some PHP, and JQuery is an everyday tool in my arsenal so I was more than happy to give it a read.
Most of us are familiar with short URL's now. They are a pretty standard feature online now. What is becoming more popular is having a custom URL for your own links. Instead of posting short URL's that contain the name of the service provider, you can create a short link that has your own custom short format.
This article will discuss different ways to Validate and Test your projects for Accessible criteria, including using standard web browsers and screen readers. I'll also list some of the more popular testing tools I've come across.
This is the third in a series of planned articles dealing with Web Accessibility. In this series I will cover what is Accessibility, how to build Accessibility into web projects, how to test and validate for Accessible users and some other factors to keep in mind when dealing with Accessibly minded projects.