[nylug-talk] IIS/Windows to Apache/Linux conversion problems (case insensitivity)

Chris Knadle Chris.Knadle at coredump.us
Wed Jul 11 18:07:06 EDT 2007


On Wednesday 11 July 2007, Chandhee Thala wrote:
> We have a site with URLs that looks like this:
>
>     http://example.com/Dir1/File.jpg
>     http://example.com/Dir2/File000.jpg
>     http://example.com/Dir2/File001.jpg
>
> The problem was that this site was running on IIS, so people referred to
> the above URLs like this:
>
>     http://example.com/dir1/file.jpg
>     http://example.com/Dir2/file000.jpg
>     http://example.com/Dir2/File001.JPG

   How is that the case?  Were individual users actually manually entering in 
a browser URL?  [Just making sure -- you touch base on this later, so I think 
the answer is no.]

> Which wasn't really a problem because Windows is case-insensitive. I
> guess IIS or Windows folded everything.
>
> So now we moved the site to Apache on Linux, and so the URLS that refer
> to the code with the wrong case are not working.

   So now the broken links are finally broken.  Okay.

> I think we have two options here:
>
>     Option 1:
>
>         Fix all references in HTML/code that refer to this URLs. If it
>         was pure HTML, I'm sure a find+grep+sed on the pages would fix
>         it, but a) there are about 300k references to these URLS and b)
>         a lot of these references are in compiled web code that we would
>         have to fix the sources for and recompile.

   There are packages designed to find broken links such as 'webcheck' 
or 'htcheck'.  I'd like to think that one of these might find broken file 
links as well.  A find+grep+sed+bash check for file existance [-e $file] is 
likewise another thought.  The idea being that by one way or another you get 
a list of all of the links that are actually broken, specified down to the 
level of which web files on which lines have problems so that they can be 
fixed.

   I conisder this to be the preferred option, as it leaves a clean state 
instead of propagating this problem further.

>     Option 2:
>
>         In the Apache conf file put in a mod speling or rewrite (not
>         sure which one is more appropriate for the task) directive that
>         folds the case for every request. I'm certain this is doable
>         (though I don't know how), but the only concern that I have is
>         that this would put significant load on what is supposed to be a
>         static images server.

   So this would try to emulate the case insensitivity of IIS.  Doing this may 
again break later (with an even larger number of web documents and filenames) 
if the method you use to emulate the broken behavior is removed.

   Ah Pook:  If Option 2 is taken first, how much do you want to bet that 
management will say "Well it works now, so we can worry about ACTUALLY fixing 
it LATER...."  Been there, had it happen.  Don't recommend it.

> Any thoughts?

   I had a brief thought about soft links, but immediately remembered seeing 
this, which is vaguely related:
      http://worsethanfailure.com/Articles/Many-Shades-of-Cout.aspx

   In short: Option 1.  Actually fix it.

   -- Chris

-- 

Chris Knadle
Chris.Knadle at coredump.us


More information about the nylug-talk mailing list