Yoast’s SEO WordPress plugin for sitemaps without htaccess
Recently, for a client, I started using Yoast’s SEO for WordPress for their blog. Everything was running nicely until we hit a snag with the .htaccess redirect for the sitemap. The client’s website, uses lighttpd, and therefore it doesn’t have all the .htaccess functionality out of the box. With Yoast’s SEO plugin your file will appear at /sitemap.xml [see mine here], which is called via htaccess. Instead of hacking the server to get the XML sitemaps working, I decided to link to the non-rewritten sitemap URL. After searching on the net and not finding any answers, I decided to delve into the code, and below is my findings.
Linking directly to the individual sitemaps
Poking into the code I’ve found out that the links appear as
- Page www.youblog.com/index.php?sitemap=page&sitemap_n=1
- Posts www.youblog.com/index.php?sitemap=post&sitemap_n=1
- Category www.youblog.com/index.php?sitemap=category&sitemap_n=1
- Post Tags www.youblog.com/index.php?sitemap=post_tag&sitemap_n=1