Last active
October 23, 2023 10:05
-
-
Save wp-seopress/9a0add04e6f13f3a030167d3562acf32 to your computer and use it in GitHub Desktop.
NGINX rewrite rules for XML Sitemaps
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
location ~ (([^/]*)sitemap(.*)|news|author|video(.*))\.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([0-9]+)?.xml$ /index.php?seopress_video=1&seopress_paged=$1 last; | |
rewrite ^.*/author.xml$ /index.php?seopress_author=1 last; | |
rewrite ^.*/sitemaps_xsl\.xsl$ /index.php?seopress_sitemap_xsl=1 last; | |
rewrite ^.*/sitemaps_video_xsl\.xsl$ /index.php?seopress_sitemap_video_xsl=1 last; | |
rewrite ^.*/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?seopress_cpt=$1&seopress_paged=$2 last; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment