Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

currently I'll be tasked soon migrating some websites from Windows to Linux. The only real catch that I've seen thus far is that the windows (soon to be Linux) site owners have built their hyperlinks in mixed case (for example they link to a file in all caps, but the file itself is named in lower case). While permissible in windows, which can resolve case-insensitive, Linux will be picky about it and throw errors.

Are there any tools out there that can rename all the files to another case, and fix all the links so they link properly to the now lower case files? Haven't seen anything thus far, but I'm sure another admin somewhere out there has run into this. Prefer the tool work with my desktop windows (Windows 7) environment that will be doing the migration. Thanks!

share|improve this question
    
I thought Apache could be configured to ignore case? Wasn't sure on that though. What are you using for your web server? –  Bart Silverstrim Sep 16 '10 at 15:26
    
Owners should be hit with a ruler on the hands until they get very red. –  LatinSuD Sep 16 '10 at 22:14
add comment

2 Answers

If you are using Apache it looks like the mod_spelling modules might be away to work around this if it is all just kind of legacy stuff. I would look into fixing it as you are however if this is high volume.

I you can't find anything for the links I would recommend looking at HTML::TreeBuilder in perl to find all the href (don't forget img tags as well) and change it all to lower case.

For the files I would use zsh with something like:

for file in **/*; do mv "$file" "${file:l}"; done

There is probably a good way to do it with GNU find as well.

share|improve this answer
add comment

Have them fix it. Any solution other than that will cause problems down the road. Tell them its bad for SEO. If you cannot, you might want to look at something like http://www.brain-dump.org/projects/ciopfs/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.