capistrano-magento2
capistrano-magento2 copied to clipboard
Magento still has issues with /pub in sitemap
As Magento still has issues with the /pub folder in the sitemap XML (see for instance the following issue) https://github.com/magento/magento2/issues/30901 I think it makes sense to solve this in the deployment.
Currently there's a shared folder located in /pub/sitemaps/ which is a symlink to the shared folder. If you use that path for creating a sitemap it will add the /pub folder in the URL of the sitemap.
This can be resolved by creating another symlink from the root of the magento folder, symlinking it to the same sitemap folder in the shared folders. In Magneto a sitemap can be submitted to the following base path "/sitemaps". It will be generated without the /pub folder in the URL and is still accessible, because there's another symlink pointing to the same folder in the /pub directory.
Or keep the sitemap in /pub/sitemaps/ and create a symlink in /pub to itself:
cd pub
ln -sfn pub .
this way you can serve from /pub and have the sitemap configured as /pub/sitemaps/
Either way https://github.com/davidalger/capistrano-magento2 already allows you to add shared folders the way you like. No modifications are needed.