Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I just noticed that XML sitemap is presenting all of the sitemap links as "http://default/" rather than the URL listed in the "default base URL" of the advanced settings for the module.
The URLs in the sitemap actually try to take me to http://default, or the appropriate non-existent subpage.
This error seems pretty critical, so I imagine it is something I did wrong with my site. Unfortunately, I can't figure out what setting I changed to create this error.
Thank you.
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #2
Illich CreditAttribution: Illich commentedResponses to Earnie's questions below, but first:
I just checked into the sitemap.xml and the problem is gone! The URLs are correct.
I didn't actually do anything between posting the initial help request and checking on it, except sleep.
So the immediate problem is solved, but the cause remains unknown.
Cron is set to run every three hours on the site, according to the cron configuration. I did manually run cron while trying to troubleshoot the http://default/ error prior to posting my initial help request.
No base_url is set. The statement is still commented:
http://experienceolympic.com
The sitemap that now works is at http://experienceolympic.com/sitemap.xml
Thank you.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedOk, hopefully it won't come back. It is usually a result of not having a $base_url set and the way cron is executed, i.e. the URI used to execute cron. If you used drush, IIRC, this has been a cause.
Comment #5
Dave the Brave CreditAttribution: Dave the Brave commentedI'm reopening since I am experiencing the same issue, and I also think drush cron should result in the correct domains since using drush cron as the cron executable is becoming more popular.
"How are you executing cron? "
I have attempted drush cron and manual cron, both generate 'default' as the domain.
"What do you have set for $base_url in settings.php? "
I have the site's base url set.
"What is the string in the default base URL?"
The same as $base_url sans the trailing slash.
I have tried different combinations of these as well with no luck.
Comment #6
TravisCarden CreditAttribution: TravisCarden commentedIf you're running cron via Drush you need to specify the URI, either manually as a command line option or via a site alias. e.g.,
drush cron --uri=http://whatever.com/
ordrush @whatever cron
.In the end, this comes down to configuration error, but I wonder if more should be done to prevent it. It would probably be fitting to add something to the documentation about it. Perhaps the module should also test for the condition and refuse to (re-)generate a sitemap based on
http://default/
as a base URL* and write an error/warning to the log.*It's difficult to imagine a scenario, even on an intranet, where such would be the intended outcome.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedI'm really scratching my head on this one... I've set $base_url, checked the URL in XML Sitemap settings, changed from a regex redirect in .htaccess to an explicit redirect, run via drush, run via Drupal, and run via curl, and I still get http://default/.
Only difference is Nginx vs Apache (works on Nginx), but I can't really do anything past the local .htaccess on HostGator. (Client wouldn't let me host his site.)
Comment #8
nickknack CreditAttribution: nickknack commentedAffiming Illich's original issue. I experienced a 24-hour lag between populating the sitemap and conversion from "http://default" to "http://site.com." Same Base URL and cron settings.
Comment #9
jonhattanThis is because using misconfigured drush. See http://docs.drush.org/en/master/cron
Comment #11
ecvandenberg CreditAttribution: ecvandenberg at Inforwijzer commentedThis issue is alive and kicking again at my old Drupal 7 websites.
Refering to post #9, that link is broken.
But when I check https://drushcommands.com/drush-8x/core/core-cron/ I do not see any issue.
How to resolve this issue other than activating the automated cron?
Comment #12
ecvandenberg CreditAttribution: ecvandenberg at Inforwijzer commentedAh...found it.
Add a base URL in your settings.php and drush cron will generate a correct xml sitemap.