Skip to content

Nginx Code for New Generation SeoPress Sitemap

Nginx Code for New Generation SeoPress Sitemap

SeoPress has updated the sitemap configuration to make it better in the eyes of Search Engines. But you need to add rewrite rules on servers that use Nginx.

You can copy the following code into your Nginx Server.

location ~ ([^/]*)sitemap(.*)\.x(m|s)l$ {
## SEOPress
rewrite ^.*/sitemaps\.xml$ /index.php?seopress_sitemap=1 last;
rewrite ^.*/news.xml$ /index.php?seopress_news=$1 last;
rewrite ^.*/video.xml$ /index.php?seopress_video=$1 last;
rewrite ^.*/author.xml$ /index.php?seopress_author=$1 last;
rewrite ^.*/sitemaps_xsl\.xsl$ /index.php?seopress_sitemap_xsl=1 last;
rewrite ^.*/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?seopress_cpt=$1&seopress_paged=$2 last;
}

Leave a Reply

Your email address will not be published. Required fields are marked *