PrestaSitemapBundle
PrestaSitemapBundle copied to clipboard
Creation of sitemap.xml files in sub directory
There is the possibility to set the target directory where the files shall be dumped to. However the links between the generated section-xml-files don't respect that and try link the files from the web root.
Similar to the file prefix a sub-directory config would be great so the created links between each sitemap-file add this sub-directory in each path.
I think if you are dumping to the sub-dir then you should configure routing prefix to be same in config/routes/presta_sitemap.yaml
or where you import the routes
If I understand correctly, you are proposing to expose the routes to the sitemap generation controller (which generates the sitemap on the fly). Due to the large amount of pages I prefer generating the sitemap.xml files regularly with a cron job:
bin/console presta:sitemaps:dump /var/www/public/sitemap/site-1 --base-url="https://www.site-1.com"
I think all it needs is to have an additional "relative-path-to-sitemap" parameter that is added to all sitemap-section-links.
From an historical point of view, this bundle was created to serve sitemap on the fly
But indeed, we moved to the dump command, because it was too much for an HTTP endpoint
This is why there is some code aimed to be working on the HTTP side that still works on dump command
So yes, I believe you could put some path in sitemap_file_prefix
(ie site-1/sitemap
) and it might work
But I think we better rethink this whole thing by making an inventory of all use cases we want to cover, and find a way to rewrite these code parts with new config structure
I've the same issue.
It's related with https://github.com/prestaconcept/PrestaSitemapBundle/issues/138
If you set --base-url, it will work. But it's not consistent