Forked from SimpleHomelab/nginx-rewrites-yoast-wordpress-seo
Created
September 14, 2016 09:41
-
-
Save eyvoro/2b1fbe43d2a3153531aef71dff3fbba2 to your computer and use it in GitHub Desktop.
Nginx rewrites for Yoast's WordPress SEO plugin. These rewrites go into the Nginx host file between the server blocks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This rewrite redirects sitemap.xml to sitemap_index.xml, which is what Yoast's WordPress SEO plugin generates. | |
rewrite ^/sitemap\.xml$ /sitemap_index.xml permanent; | |
# This rewrite ensures that the styles are available for styling the generated sitemap. | |
rewrite ^/([a-z]+)?-?sitemap\.xsl$ /index.php?xsl=$1 last; | |
# These rewrites rule are generated by Yoast's plugin for Nginx webserver | |
rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last; | |
rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment