Case Sensitivity in Linux Server

Discussion in 'HTML' started by Roy Schestowitz, Mar 23, 2005.

  1. A relative of mine compiled an extensive (~3,000 files) network of
    genealogical Web pages. The problem is: he built all of this on a Windows
    machine and made /many/ uppercase-lowercase inconsistencies. Due to the
    large bulk of files, changing this by hand would be very impractical.

    Is there a way I could graft the files onto a Linux server and get them to
    work properly? Are there special settings/options for the server (maybe
    ..htaccess)? Are there tools that scan the files and convert them in some
    way (also within) to make them all lower- or upper-case?

    I would greatly appreciate your help on this.

    Roy
     
    Roy Schestowitz, Mar 23, 2005
    #1
    1. Advertising

  2. Roy Schestowitz

    Toby Inkster Guest

    Roy Schestowitz wrote:

    > Is there a way I could graft the files onto a Linux server and get them
    > to work properly?


    Assuming an Apache server, try mod_speling (sic).

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Mar 23, 2005
    #2
    1. Advertising

  3. Toby Inkster wrote:

    > Roy Schestowitz wrote:
    >
    >> Is there a way I could graft the files onto a Linux server and get them
    >> to work properly?

    >
    > Assuming an Apache server, try mod_speling (sic).


    As I am not the sysadmin of that Web server, I don't know if this can
    provide a solution. I looked up your good suggestion and found that the
    CheckSpelling directive needs to be changed -- something which I cannot do
    myself. Perhaps I am missing something...

    Is there a script that renames all directories and files to pure lowercase
    and then changes all links in the files appropriately?

    Roy

    --
    Roy Schestowitz
    http://schestowitz.com
     
    Roy Schestowitz, Mar 23, 2005
    #3
  4. Roy Schestowitz

    Mitja Guest

    On Wed, 23 Mar 2005 15:50:36 +0000, Roy Schestowitz
    <> wrote:

    > Toby Inkster wrote:
    >> Roy Schestowitz wrote:
    >> Assuming an Apache server, try mod_speling (sic).

    > CheckSpelling directive needs to be changed -- something which I cannot
    > do myself. Perhaps I am missing something...

    nope, that's ok. Toby assumed you had sufficient privileges to do it.

    > Is there a script that renames all directories and files to pure
    > lowercase and then changes all links in the files appropriately?


    That's pretty basic so I doubt there's a script for it. To rename the
    files to lowercase (in bash):
    for $fn in `find -name '*.html' | sort -r`; do mv $fn `echo $fn | tr
    [:upper:] [:lower:]`; done

    I sort the files in reverse order before processing here so ./Foo/Bar gets
    renamed before the folder Foo becomes foo and ./Foo/Bar starts pointing
    nowhere.

    To do the magic inside the files:
    perl -p -i -e 's/(href=".*?")/\L$1/' `find -name '*.html'`

    Disclaimer: tested VERY briefly, but should work.
    Feel free to ask if you need any modifications/explanations.

    Mitja
     
    Mitja, Mar 23, 2005
    #4
  5. Roy Schestowitz

    JDS Guest

    JDS, Mar 23, 2005
    #5
  6. Roy Schestowitz

    Toby Inkster Guest

    Mitja wrote:
    > Roy Schestowitz <> wrote:
    >
    >> Is there a script that renames all directories and files to pure
    >> lowercase and then changes all links in the files appropriately?

    >
    > That's pretty basic so I doubt there's a script for it. To rename the
    > files to lowercase (in bash):
    > for $fn in `find -name '*.html' | sort -r`; do mv $fn `echo $fn | tr
    > [:upper:] [:lower:]`; done


    But that doesn't update the links. For that you'll probably want to do a
    bit of Perl regexp stuff.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Mar 23, 2005
    #6
  7. Roy Schestowitz

    Toby Inkster Guest

    Roy Schestowitz wrote:

    > As I am not the sysadmin of that Web server,


    So give the sysadmin some beer and get him to do it for you. This *always*
    works.

    > I don't know if this can provide a solution. I looked up your good
    > suggestion and found that the CheckSpelling directive needs to be
    > changed -- something which I cannot do myself.


    Not even in an .htaccess file?

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Mar 23, 2005
    #7
  8. Toby Inkster wrote:
    > Mitja wrote:
    >
    >>Roy Schestowitz <> wrote:
    >>
    >>>Is there a script that renames all directories and files to pure
    >>>lowercase and then changes all links in the files appropriately?

    >>
    >>That's pretty basic so I doubt there's a script for it. To rename the
    >>files to lowercase (in bash):
    >>for $fn in `find -name '*.html' | sort -r`; do mv $fn `echo $fn | tr
    >>[:upper:] [:lower:]`; done

    >
    > But that doesn't update the links. For that you'll probably want to do a
    > bit of Perl regexp stuff.


    Are you sure you read Mitja's whole post?

    > To do the magic inside the files:
    > perl -p -i -e 's/(href=".*?")/\L$1/' `find -name '*.html'`
     
    Leif K-Brooks, Mar 23, 2005
    #8
  9. Roy Schestowitz

    Toby Inkster Guest

    Leif K-Brooks wrote:

    > Are you sure you read Mitja's w


    Whole posts are so old fashioned.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Mar 23, 2005
    #9
  10. Mitja wrote:

    > On Wed, 23 Mar 2005 15:50:36 +0000, Roy Schestowitz
    > <> wrote:
    >
    >> Toby Inkster wrote:
    >>> Roy Schestowitz wrote:
    >>> Assuming an Apache server, try mod_speling (sic).

    >> CheckSpelling directive needs to be changed -- something which I cannot
    >> do myself. Perhaps I am missing something...

    > nope, that's ok. Toby assumed you had sufficient privileges to do it.
    >
    >> Is there a script that renames all directories and files to pure
    >> lowercase and then changes all links in the files appropriately?

    >
    > That's pretty basic so I doubt there's a script for it. To rename the
    > files to lowercase (in bash):
    > for $fn in `find -name '*.html' | sort -r`; do mv $fn `echo $fn | tr
    > [:upper:] [:lower:]`; done
    >
    > I sort the files in reverse order before processing here so ./Foo/Bar gets
    > renamed before the folder Foo becomes foo and ./Foo/Bar starts pointing
    > nowhere.
    >
    > To do the magic inside the files:
    > perl -p -i -e 's/(href=".*?")/\L$1/' `find -name '*.html'`
    >
    > Disclaimer: tested VERY briefly, but should work.
    > Feel free to ask if you need any modifications/explanations.
    >
    > Mitja


    I found some other solution in the mean time. It is very similar and I am
    writing about it at the moment:

    http://www.schestowitz.com/Software/Lowercase/

    Roy
     
    Roy Schestowitz, Mar 24, 2005
    #10
  11. Toby Inkster wrote:

    > Roy Schestowitz wrote:
    >
    >> As I am not the sysadmin of that Web server,

    >
    > So give the sysadmin some beer and get him to do it for you. This *always*
    > works.
    >
    >> I don't know if this can provide a solution. I looked up your good
    >> suggestion and found that the CheckSpelling directive needs to be
    >> changed -- something which I cannot do myself.

    >
    > Not even in an .htaccess file?


    Is that possible? I hope not, or else I spent hours in vain. *wink*

    Roy

    --
    Roy Schestowitz
    http://schestowitz.com
     
    Roy Schestowitz, Mar 24, 2005
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harry Whitehouse
    Replies:
    0
    Views:
    305
    Harry Whitehouse
    Sep 15, 2004
  2. Replies:
    0
    Views:
    468
  3. Kev
    Replies:
    15
    Views:
    852
    Lunchbox G4
    Jan 3, 2005
  4. asqui
    Replies:
    0
    Views:
    256
    asqui
    Aug 17, 2004
  5. asqui
    Replies:
    0
    Views:
    294
    asqui
    Aug 17, 2004
Loading...

Share This Page