Login or e-mail Password   

Using Apache

(This article is Part 2 in a series about Apache’s loadable modules. The previous topic was mod_ext_filter ). As former Microsoft-ite who made the leap to OSS, one of the...
Views: 3.298 Created 02/14/2007

(This article is Part 2 in a series about Apache’s loadable modules. The previous topic was mod_ext_filter).

As former Microsoft-ite who made the leap to OSS, one of the things that took a little getting used to with Apache are that filenames are case-sensitive. While that’s long since been hammered into my soul, a great many other people browsing the web aren’t aware that some webservers are case-senstive, while others are not. Sometimes I’ll see “http://www.example.com/signup” in my access logs when what the person really wanted is “http://www.example.com/Signup”. I could easily catch these simple typos with a mod_rewrite rule, but what if the user entered “http://www.example.com/Sign-up” or “http://www.example.com/Signpu”? Trying to plan for the ways a URL could be miscontrued would be make for a lot of ugly mod_rewrite rules. A better choice is to load Apache’s mod_speling module.

Mod_speling is very easy to implement. And what’s more, unlike mod_ext_filter, it can be used from within an .htaccess file–shared hosting users rejoice! The module is normally loaded by default (though spell-checking is disabled), but you might want to double-check Apache’s http.conf:

LoadModule speling_module modules/mod_speling.so

Enabling mod_speling is as easy as:

<IfModule mod_speling.c>
CheckSpelling on
</IfModule>

A couple of points to remember:

  • mod_speling will only catch and correct up to one URL misspelling at a time. For true fuzzy matching you’ll have to use a more advanced solution.
  • If Apache finds several likely matching URLs, the user will be presented with a list to pick from.
  • Renaming files and not updating links, relying upon mod_speling to automagically fix them, isn’t a great idea. The module does a directory scan each time it intercepts a 404. If you have a lot misspelled files and a lot of pageviews, you will experience a noticable performance degradation.

For more information, check out the official Apache docs.

Similar articles


10
comments: 6 | views: 12449
10
comments: 1 | views: 6523
6
comments: 0 | views: 8814
6
comments: 0 | views: 4382
6
comments: 0 | views: 11618
6
comments: 2 | views: 5581
 
Author
Article
Additional information
Groups

Related topics





  lcklck16,  07/05/2017

20170705lck
http://www.oakley-sunglasses.nom.co
http://www.ralphlauren-pascher.fr
http://www.christian-louboutin(...).us.com
http://www.mont-blancpens.com.co
...  show more



Add your opinion
You must be logged in to write a comment. If you're not a registered member, please register. It takes only few seconds, and you get an access to additional functions .
 


About EIOBA
Articles
Explore
Publish
Community
Statistics
Users online: 124
Registered: 107.587
Comments: 1.493
Articles: 7.189
© 2005-2018 EIOBA group.