Closed Fahad-Alsaidi closed 6 years ago
Try to change this location
## XML Sitemap support.
location = /sitemap.xml {
try_files $uri @drupal-no-args;
}
to
## XML Sitemap support.
location ~ ^sitemap\.xml$ {
try_files $uri @drupal-no-args;
}
@iryston I edit /etc/nginx/apps/drupal/drupal.conf but it doesn't work, now the main page of sitemap.xml doesn't work, check: https://itwadi.com/sitemap.xml
@Fahad-Alsaidi Sorry, that's my mistake.
You don't need to change location above. So, revert it back.
Just add this one to your config
location ^~ /sitemaps/ {
location ~ ^/sitemaps/[[:digit:]]+/sitemap.xml$ {
try_files $uri @drupal-no-args;
}
}
Thanks @iryston, now it works.
I am using Drupal 8 and simple_sitemap to generate sitemap.xml. my site have more than 2000 nodes so simple_sitemap divided sitemap to sub-sitemaps like this: https://itwadi.com/sitemaps/1/sitemap.xml https://itwadi.com/sitemaps/2/sitemap.xml when I try to open one of these urls, I got 404 Not Found.
you can check here: https://itwadi.com/sitemap.xml