Creating a sitemap
March 17, 2011
Posted by on
So far I had never created a full sitemap for Download Central. Now I searched for a tool that could do that for me. There are a number of sites that offer this as a free service, unfortunately it seems that they all use the same script, and this script is case insensitive—it converts the URLs completely to lower case.
So, what to do?
The solution was quite simple: a standard Windows directory listing, and a few global replaces with a regex-capable tool. That it turned out to be so simple was however only due to the file structure that I use, where every page is a directory. All I had to do was this:
dir /s index.shtml > sitemap.xml
That gave me a list with entries like this one:
Directory of I:\htdocs\dlc\Amiga\Games\A\ASokoban-3
2011-03-10 12:44 2,569 index.shtml
1 File(s) 2,569 bytes
These entries had to be converted to this format:
This is not particularily difficult, but it only worked because it was the directories I was after, not the files. Note that each page now even has its correct modification date!