Create a sitemap for your site – my pub history sitemap

It is not until you hit a point in your life where everything is wrong, that you make it right.

Google always offers a good example.

Google is great for telling you what is wrong, but does not give much away, hoping you may spend some money with their people!

You need to search very hard for the correct answers in google, as they don’t really exist. Lots of shit does exist in google, but not always correct.

I spent years trying to create a simple sitemap for my site using python, or something similar. The examples were clear, but I failed every time.

Then I realised that a one or two line script would work, it is as simple as that. If you make a mistake,you rerun the script!

Simple.

Here it is:

You need to have access to a linux server, as this does not work for Windows server crap! Change directory to the top level.

e.g. cd /var/www/vhosts/pubshistory.com/httpdocs

then run this command as root

find `pwd` > mout

cat mout | grep shtml > mouth.txt

or
cat mout | grep html > mouth.txt (if you use html as your file extension)

Then download mouth.txt using ftp, edit is and upload it again.

Then upload this new sitemap to google webmaster tools if you have an account, as you should.

If you get errors in uploading at this point, delete the version of mouth.txt on the server, as it belongs to root, and there may be problems over-writing this original file.

Absolutely f### brilliant, and works every time.

Leave a comment

Your email address will not be published. Required fields are marked *