-
Notifications
You must be signed in to change notification settings - Fork 9.4k
sitemap.xml build wrong urls for sitemapindex via cron #9440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hello. Steps to reproduce:
Here is my sitemap.xml
Please, correct me if you tried in another way. |
@TomashKhamlai, just FYI: it feels like this is a duplicate of #5321 (comment), but @christian-forgacs isn't talking about images in his opening post, so I'm not entirely convinced that he is reporting the same bug. |
@christian-forgacs are you using NGINX as a server? |
@TomashKhamlai yes we're using NGINX as server. |
I can also replicate this. The problem happens for me when running the sitemap generation through bin/magento cron:run from outside of the magento directory. e.g our magento code is in /var/www/src, if I run I believe the problem can be traced back to \Magento\Sitemap\Model\Sitemap::_getStoreBaseDomain, the $storeDomain variable returned is incorrect under the conditions described. I believe it is due to the logic in this condition Similarly if I run
This is due to $documentRoot being empty in the same condition causing this error:
|
@christian-forgacs , thank you for your report. Steps to reproduce with NGINX and Magento version 2.1.6 :
Please provide more details regarding your environment, or try to reproduce this |
@christian-forgacs, thank you for your report. |
I can confirm this happens when the sitemap itself is an index file that contains sitemap children (in shops with 50k+ pages). So if I create a sitemap.xml file under the /pub/ path, its address will be /pub/sitemap.xml but it will contain sitemap children such as http://example.com/websites/example.com/public_html/pub/sitemap-1-1.xml which aren't valid paths. Hope that helps! |
I can also confirm that this is an issue with the sitemap index. A workaround would be to change the cron job like this:
And if you are running you document root inside pub:
|
More errors:
https://piezas-portatiles.com/index.php/bateria-para-acer-aspire-e1-522-e1-530-li-ion-14-8v-2600mah-bt28.html2017-05-31T08:30:48+00:00daily1.0image:imageimage:lochttps://piezas-portatiles.com/pub/media/catalog/product/cache/03b00c63a37940b60c758eb1601e45c8/b/t/bt28.jpg</image:loc>image:titleBateria para Acer ASPIRE E1-522 E1-530 Li-ion 14,8v 2600mAh BT28</image:title></image:image>image:imageimage:lochttps://piezas-portatiles.com/pub/media/catalog/product/cache/03b00c63a37940b60c758eb1601e45c8/b/t/bt28-1.jpg</image:loc>image:titleBateria para Acer ASPIRE E1-522 E1-530 Li-ion 14,8v 2600mAh BT28</image:title></image:image>image:imageimage:lochttps://piezas-portatiles.com/pub/media/catalog/product/cache/03b00c63a37940b60c758eb1601e45c8/b/t/bt28-2.jpg</image:loc>image:titleBateria para Acer ASPIRE E1-522 E1-530 Li-ion 14,8v 2600mAh BT28</image:title></image:image>image:imageimage:lochttps://piezas-portatiles.com/pub/media/catalog/product/cache/03b00c63a37940b60c758eb1601e45c8/b/t/bt28-3.jpg</image:loc>image:titleBateria para Acer ASPIRE E1-522 E1-530 Li-ion 14,8v 2600mAh BT28</image:title></image:image>image:imageimage:lochttps://piezas-portatiles.com/pub/media/catalog/product/cache/03b00c63a37940b60c758eb1601e45c8/b/t/bt28-4.jpg</image:loc>image:titleBateria para Acer ASPIRE E1-522 E1-530 Li-ion 14,8v 2600mAh BT28</image:title></image:image> |
Some products and categories have unfriendly URLs:
|
above solution is work for me |
…-19-2024 [Support Tier-4-Kings glo16746] 12.19.2024 Regular delivery of bugfixes and improvements
In our setup the sitemap generation build wrong urls for the sitemapindex via cron.
Preconditions
Steps to reproduce
Expected result
Actual result
The text was updated successfully, but these errors were encountered: