| Home | NPA/NPX |


Site Map

I employ a standard tree traversal from the root folder of the server, and build a list of files that have HTML extensions. With this list, I create a new Google compatible 'sitemap.xml' in the root folder. Unlike most scripts that start by reading your index.html file and parsing out all the <a> tags, mine uses the server file system to locate pages with HTML extensions.

My goal with this was to dynamically create this page from our Google sitemap.xml file. My first attempt at this is here Site Map #1 - it's not quite what I was after, but close. This uses a PHP script to read the Google sitemap.xml and display each <loc>value</loc> as an anchor. It's done in the order that the urls appear in the sitemap.xml as created by my other script.

Now have a look at this Site Map #2 - this is another PHP script that reads the sitemap.xml file, opens each file, reads the first 3000 characters into a string, locates the beginning and ending of the <title> tag and extracts the page title. The URL and title are then stacked in an array, sorted on the title, then output as a list of anchors. This is a lot more work, but doesn't seem to take any longer, and I think it's much more meaningful.

Lastly, to make life easy on myself, I created a log-in form so I can just click Create Site Map and provide the correct key and password to generate a new Google sitemap.xml file.

If you would be interested in seeing my scripts, please contact me and I can make them available to you on the web.