Skip to content

Instantly share code, notes, and snippets.

@waiting0514
Forked from joshuafredrickson/.htaccess
Created February 21, 2018 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waiting0514/d2441227ccb91812e67f1c6f97a1d311 to your computer and use it in GitHub Desktop.
Save waiting0514/d2441227ccb91812e67f1c6f97a1d311 to your computer and use it in GitHub Desktop.
.htaccess: WordPress Yoast SEO Sitemap Fix
# WordPress SEO - XML Sitemap Rewrite Fix
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^locations.kml$ /index.php?sitemap=wpseo_local_kml [L]
RewriteRule ^geo_sitemap.xml$ /index.php?sitemap=geo [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