Last active
May 1, 2019 07:02
-
-
Save SimpleHomelab/bae0723c49aac16b57e9 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 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
Where Exactly do you put it inside the Server Block... Pls help
I am using NGinx as Reverse Proxy
server {
listen xxx.xxx.xxx.xxx:80;
server_name xxxxxx.com www.xxxxxx.com;
error_log /var/log/apache2/domains/xxxxxx.com.error.log error;
}