Skip to content

Instantly share code, notes, and snippets.

@jdevalk
Last active December 16, 2015 00:09
Show Gist options
  • Save jdevalk/5345863 to your computer and use it in GitHub Desktop.
Save jdevalk/5345863 to your computer and use it in GitHub Desktop.
Fix XML sitemaps to work by forcing .htaccess to pick them up. Add this to the .htaccess, **above** the WordPress rewrites.
# WordPress SEO - XML Sitemap Rewrite Fix
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
# END WordPress SEO - XML Sitemap Rewrite Fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment