I had a problem, some might say that I have many problems but this one I found a solution to, so it thought it would be a good plan to share it.
It concerns case sensitivity when running Apache on unix and it comes in two parts.
Firstly we are using apache rewrite to create friendly URLs and this works fine you type in
www.myniftysite.com/blog/postaboutmonkeydust and this gets parsed through apache and the rewrite thingy checks the rules setup finds the correct piece of code to run and presents page.
To achieve this you put something like this in your .htaccess file
# check the RewriteEngine is switched on else this won't work
RewriteEngine on
#do a Rewrite rule
RewriteRule ^blog/(.+)$ /blogs.cfm?sParams=$1 [L]and this works fine as long as your site users don't do this
www.myniftysite.com/BLOG/postaboutmonkeydustBecause unix being unix it will say sorry matey I can't BLOG I have a rewrite rule called blog but I won't tell you about that because BLOG and blog are different.
so to get the Rewrite rule to find
www.myniftysite.com/blog/postaboutmonkeydust
www.myniftysite.com/Blog/postaboutmonkeydust
www.myniftysite.com/BLOG/postaboutmonkeydustand another combinations of case you need to add 'NC' to the rule thus
RewriteRule ^blog/(.+)$ /blogs.cfm?sParams=$1 [L,NC]FYI
'NC' means no case.
Now that's the first part of the solution and I can claim no credit for getting this far as
this helpful fella did all the work and
Riccardo even found the link for me all I had to do was read.
However, as I said this is a two part problem, while apache Rewrite handles the URL case sensitivity it can do nothing useful for physical files sooooooo....
when you links to physical files on your server such as
www.myniftysite.com/myfilestore/postaboutmonkeydust.pdf
as long as the file is called
postaboutmonkeydust.pdf that's fine but if it is called
PostAboutMonkeyDust.pdf then it won't be found.
While there are a number of solutions to this you could put in place such always saving files on the system in lowercase or even just using a consistent naming convention, people being people means that somewhere along the way you are going to get broken links.
So the best solution I have found is mod_speling ( yes it is spelt incorrectly and yes the irony is not lost on me (but i am sure it is intentional )).
This module is available in Apache 1.3 and later and as an extranl module in prior versions and its cool. When enabled it cahecks for physical files on your system ignoring case and will even ignore a single spelling mistake, quite frankly it rocks and what's more its really simple to implement.
Simply slam this into the httpd.conf file
CheckSpelling onand apply the changes and just sit back and watch in amazement :D