Fixing Capitalization Problems


NoCase on


Windows has a noncase sensitive file system, while Unix systems are case sensitive. This usually creates problems when migrating websites from Windows to Unix servers. All of a sudden, URLs such as http://www.example.com/images/icon. PNG that used to work fine on Windows start failing with Document Not Found errors, because the file on disk is named icon.png and is not equivalent on Unix to the icon.PNG file requested. This issue can be solved by manually checking and rewriting every link or by enabling the mod_speling module as described in the previous section.

There is also an alternative, single-purpose module that can be used to this end: mod_nocase. This module, originally based on mod_speling, makes GET request for URLs noncase sensitive. It checks for an exact URL match and if it does not find it, it tries a noncase sensitive matching. If multiple files match the noncase sensitive search, the first one will automatically be selected. To enable mod_nocase, you should load it into the server and include a NoCase directive in your Apache configuration file, as shown in the example.

You can download mod_nocase from http://www.misterblue.com/Software/mod_nocase.htm.

Remember that enabling either mod_speling or mod_nocase has an impact on the performance of the server.




Apache(c) Phrase Book(c) Essential Code and Commands
Apache Phrasebook
ISBN: 0672328364
EAN: 2147483647
Year: 2006
Pages: 254

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net