SEOPress sitemaps.xml 404 issue
-
I have discovered that WP Cloudflare Super Page Cache nginx rules are breaking my SEOPress sitemap. Please read on for details…
I’m currently using SEOPress on nginx, with the following rewrite rules in a conf file:
location ~ ([^/]*)sitemap(.*).x(m|s)l$ { ## SEOPress rewrite ^/sitemaps.xml$ /index.php?seopress_sitemap=1 last; rewrite ^/sitemaps/news.xml$ /index.php?seopress_news=$1 last; rewrite ^/sitemaps/video.xml$ /index.php?seopress_video=$1 last; rewrite ^/sitemaps/author.xml$ /index.php?seopress_author=$1 last; rewrite ^/sitemaps_xsl.xsl$ /index.php?seopress_sitemap_xsl=1 last; rewrite ^/sitemaps/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?seopress_cpt=$1&se$
As soon as I add the WP Cloudflare Super Page Cache nginx rules, my sitemaps.xml file throws a 404 error. Turning off the rules immediately fixes the issue. The rules I’m referring to are:
location ~* \.(xml|xsl)$ { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; } location /robots.txt { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; } location ~* \.(css|js|pdf)$ { add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=2592000, stale-while-revalidate=86400, stale-if-error=604800"; expires 30d; } location ~* \.(jpg|jpeg|png|gif|ico|eot|swf|svg|webp|avif|ttf|otf|woff|woff2|ogg|mp4|mpeg|avi|mkv|webm|mp3)$ { add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=31536000, stale-while-revalidate=86400, stale-if-error=604800"; expires 365d; } location /wp-cron.php { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; } location = /wp-content/wp-cloudflare-super-page-cache/mydomain.com/debug.log { access_log off; deny all; }
I’m no expert with nginx so I’m not sure what about this rule is breaking the SEOPress rewrite rules. Maybe it’s an easy fix, maybe not, but I’m hoping someone here might have the answer.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘SEOPress sitemaps.xml 404 issue’ is closed to new replies.