Skip to content

Instantly share code, notes, and snippets.

@jdevalk
Created April 9, 2013 13:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdevalk/5345872 to your computer and use it in GitHub Desktop.
Save jdevalk/5345872 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. This version assumes you're using a subfolder install with WordPress installed in /wordpress/, adapt if needed.
# WordPress SEO - XML Sitemap Rewrite Fix
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^sitemap_index.xml$ /wordpress/index.php?sitemap=1 [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /wordpress/index.php?sitemap=$1&sitemap_n=$2 [L]
# END WordPress SEO - XML Sitemap Rewrite Fix
@ex-jedi
Copy link

ex-jedi commented Sep 18, 2014

Yep, seems to work fine. Thanks for that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment