Hi,
I have a site which is accessible via two equivalent domains, one of which is the preferred one that we want XML Sitemap to use within its URLs.
I have read 202344 which discusses a similar issue, however the solution proposed is to edit the settings.php to "hard-code" into Drupal what the correct domain should be via the $base_url variable.
This workaround isn't an acceptable solution for me, because I back up our entire site onto a development server regularly (which of course has yet another domain) which means I would have to exclude the settings.php from this backup - and of course lose any other changes within the settings.php from the backup.
I want to understand how XML Sitemap "discovers" the domain so that I might find some other way to solve the problem.
One of the posts against the other issue (202344) mentioned above suggests that if the settings.php does not have a $base_url specified, then the domain that was used to request cron.php when the sitemap was generated will be used. However in my case, my crontab entry makes a request to the correct domain - so why does XML Sitemap then generate URLs via the other domain?
If someone could explain how XML sitemap determines which domain to use in its URLs that would be really helpful -- then I can have a look at how I might solve the problem without the need to put a $base_url in my settings.php.
Thanks,
Jon
Comments
Comment #1
darren ohWhatever domain is first used to request the site map will be used until the site map changes.