How to Set up sitemap.xml on Apache Servers?
Squirrly SEO automatically generates your sitemap when you enable the XML Sitemap settings.
On some Apache servers, based on the server configuration, you may need to add server-level rewrites to correctly set up the sitemap.xml file.
For this purpose, we recommend setting the following rules for Squirrly SEO sitemap in .htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^sitemap.xml$ /index.php?sq_feed=sitemap [L]
RewriteRule ^sitemap-posts.xml$ /index.php?sq_feed=sitemap-post [L]
RewriteRule ^sitemap-posts.xml\?page=([0-9]+)$ /index.php?sq_feed=sitemap-post&page=$1 [L]
RewriteRule ^sitemap-pages.xml$ /index.php?sq_feed=sitemap-page [L]
RewriteRule ^sitemap-pages.xml\?page=([0-9]+)$ /index.php?sq_feed=sitemap-page&page=$1 [L]
RewriteRule ^sitemap-categories.xml$ /index.php?sq_feed=sitemap-category [L]
RewriteRule ^sitemap-tags.xml$ /index.php?sq_feed=sitemap-tag [L]
RewriteRule ^sitemap-archives.xml$ /index.php?sq_feed=sitemap-archive [L]
RewriteRule ^sitemap-archives.xml\?type=([a-z]+)$ /index.php?sq_feed=sitemap-archive&type=$1 [L]
RewriteRule ^sitemap-custom-taxonomies.xml$ /index.php?sq_feed=sitemap-custom-tax [L]
RewriteRule ^sitemap-custom-taxonomies.xml\?page=([0-9]+)$ /index.php?sq_feed=sitemap-custom-post&page=$1 [L]
RewriteRule ^sitemap-custom-taxonomies.xml\?page=([0-9]+)&type=([a-z]+)$ /index.php?sq_feed=sitemap-custom-post&page=$1&type=$2 [L]
RewriteRule ^sitemap-custom-posts.xml$ /index.php?sq_feed=sitemap-custom-post [L]
RewriteRule ^sitemap-custom-posts.xml\?page=([0-9]+)$ /index.php?sq_feed=sitemap-custom-post&page=$1 [L]
RewriteRule ^sitemap-custom-posts.xml\?page=([0-9]+)&type=([a-z]+)$ /index.php?sq_feed=sitemap-custom-post&page=$1&type=$2 [L]
RewriteRule ^sitemap-([a-z]+).xml$ /index.php?sq_feed=sitemap-$1 [L]
</IfModule>
NOTE! In case you are not 100% sure where to add these rules, we recommend reaching out to your web host or server admin and asking for further assistance.
Still Need Help?
If you’ve added the rewrite rules in the correct file, and you still encounter issues, they are likely linked to other settings on your server. You can always reach out to our support team via one of the available channels whenever you need more assistance.