Just installed Google XML Sitemaps into the Bedrock site via composer:
"require": { "php": ">=5.5", "etc etc": "..." "wpackagist-plugin/google-sitemap-generator": "4.0.8" }
Plugin displayed this message:
"Since you are using Nginx as your web-server, please configure the
following rewrite rules in case you get 404 Not Found errors for your
sitemap:
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml$ "/index.php?xml_sitemap=params=$2" last;
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml\.gz$ "/index.php?xml_sitemap=params=$2;zip=true" last;
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html$ "/index.php?xml_sitemap=params=$2;html=true" last;
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html.gz$ "/index.php?xml_sitemap=params=$2;html=true;zip=true" last;
Followed Scott’s documentation to do so, and created a file with the following content:
server {
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml$ "/index.php?xml_sitemap=params=$2" last;
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml\.gz$ "/index.php?xml_sitemap=params=$2;zip=true" last;
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html$ "/index.php?xml_sitemap=params=$2;html=true" last;
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html.gz$ "/index.php?xml_sitemap=params=$2;html=true;zip=true" last;
}
It’s named rewrites.conf.j2
and resides at:
trellis/roles/wordpress-setup/templates/includes.d/delapiedralawfirm.com/rewrites.conf.j2
.
Deployed and now blablabla.com/sitemap.xml is resolving.
Thought it might help someone.