0

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!

tekiegreg
  • 126
  • 7

2 Answers2

0

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.

Kyle Brandt
  • 82,107
  • 71
  • 302
  • 444
0

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/

alex
  • 1,329
  • 6
  • 9