Create Site Map Tutorial - Page 6
Create Site Map Tutorial - Page 1
Create Site Map Tutorial - Page 2
Create Site Map Tutorial - Page 3
Create Site Map Tutorial - Page 4
Create Site Map Tutorial - Page 5
If you like this script, you can download a generic, commented copy here.
The things you need to set are near the top and include
- $siteUrl - the url of your site (i.e. http://www.mikrosight.com)
- $sitePath - the file server path to your site (i.e. /home/mikrosight/public_html/)
- $ignore - add/remove directory, file, extensions, file.ext
- $ignoreIn - add/remove anything that is a partial file name
I would also set the $myKey and $myPass to something unique for your site. If you are worried about security, you could also change the names of the $_POST parameters to something more unusual. It takes all four values - both parameter names AND the values to be correct to make this script run, otherwise it redirects back to the main site page.
If you don't care who runs it, or don't intend to call it from a form, you can remove all of that stuff. My only concern was some twit possibly running it over and over and over and crashing my server - so I added this stuff.
UPDATE 12/15/2006: I recently moved all my sites to HostNine - all of a sudden this script stopped working. All files on this new host had permissions set to O644 - I had to modify the permissions to O666 on the sitemap.xml file which of cuorse, since the script failed to run, the file did not exist, so I just created an empty file and changed the permissions to run the script.
Feel free to contact me with questions.