I discovered, by chance, that my new host has the Apache module mod_speling1 installed on their web-servers.
mod_speling is a smart module that tries to resolve URLs when the core Apache module is unable to: those which would otherwise result in a 404 error for the user.
It adds case-insensitivity to the web-server and is able to deal with character transpositions, omissions and other typographical errors. If it finds a resource that almost matches the original request then it will return that resource directly, via redirection. If it finds multiple possible matches, then it displays a linked-list of them to the user.
Example | Incorrect URI | Resolves To |
---|---|---|
Misspelling | /weblog/trailing-stash.html | /weblog/trailing-slash.html |
Transposition | /weblog/xeploring-web-typography.html | /weblog/exploring-web-typography.html |
Incorrect Case | /weblog/The-Wonder-of-DOMDocument.html | /weblog/the-wonder-of-domdocument.html |
Missing Character | /weblog/mixin-secured-and-unsecured-assets-without-browser-errors.html | /weblog/mixing-secured-and-unsecured-assets-without-browser-errors.html |
Missing Extension | /weblog/simple-retina-friendly-and-responsive-imagery | /weblog/simple-retina-friendly-and-responsive-imagery.html |
Multiple Matches | /weblog/managing-field-notes_part-x.html | Linked-list |
I like mod_speling. I think it makes the web a little more friendly and usable. While 404 pages can be cool, you hope that your visitors will never encounter such an error on your website. With mod-speling as its wing-man, your website will handle lots of bad URLs elegantly and transparently, and that’s a win.
-
For those who don’t get irony, that’s an intentional typo on the part of mod_speling’s author(s). ↩︎