: How do I specify the Google sitemap generator destination directory Is there a way to specify the location of generated sitemap files using the lastest version of the Google Sitemap Generator?
Is there a way to specify the location of generated sitemap files using the lastest version of the Google Sitemap Generator?
Version is: 1.0.0.0? (a very un-google version number, lol):
> sudo /usr/local/google-sitemap-generator/bin/sitemap-daemon -v
Google Sitemap Generator (Beta) Version [1.0.0.0]
The dashboard has a option of "Sitemap file name" but there is no option to specify the destination directory? It always places the generated sitemap XML files in the document root. I assume it discovers the document root from reading the webserver logs.
Why do I want to put the sitemap files in another directory?
The document root is no good for our deployment method because it is a symlink to the current deployment directory which changes daily. In order for the sitemaps to appear as if they are at the url root (i.e. www.example.com/sitemap.xml), we use a alias rule to map XML files to where we actually keep them, e.g. using nginx:
# Alias all XML files (e.g. Rss) to shared directory
location ~* /(.*.xml)$ {
alias /var/www/live/shared/xml/;
}
More posts by @Rivera981
3 Comments
Sorted by latest first Latest Oldest Best
I've had the same problem and didn't find my answer here or on any google help or config file. So let me share it here !
I read my logs and see :
2012-08-21T17:55:01Z: Writer can't open file: /htdocs/web_sitemap_4149a902_000.xml (2)
You must create a symlink called "htdocs" on your system root directory :
cd /
ln -s /home/www/yoursiterootdir htdocs
Don't ask me if symlinks are working on Windows but I found that command nearly "ln" for cows on Windows (NTFS) !
mklink [[/D] | [/H] | [/J]] linkName target
and then :
2012-08-21T18:05:01Z: Succeeded to generate [Web Sitemap] for site [....]
and where I needed it
enjoy
I have not used that tool so I do not know the direct answer to your question. However, if you can't find a way to put the files elsewhere, you can just copy them to a different folder like this:
cp -t sitemaps/ *.xml
Where sitemaps is the folder name and *.xml selects all the input files, assuming they have a .xml extension. You can create a batch script that runs the sitemap generator and then copies the files, all in one.
Although the official protocol says sitemaps should be in the root, in reality they can go anywhere on the same domain (I have put them in their own sitemaps folder before, with no problems).
You should also create a sitemap index file if you have a lot of sitemaps. This way you only need to submit the index file to each webmaster tools.
The official sitemap protocol says it should be located at the root URL that all the files it points to share in common. So if the URLs in your sitemap are like www.example.com/site/image1.jpg and www.example.com/site/mypage.html, you could put the sitemap.xml file either in www.example.com/site/sitemap.xml or www.example.com/sitemap.xml.
If you are unable to put a sitemap in that directory for whatever reason, you can put it anywhere on your server as long as your .htaccess or ISAPI Rewrite (or any other URL rewriter) can "pretend" that it's at the root. I've done that successfully using ISAPI Rewrite on an ASP site.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.