Bug #86659
closedSitemap with static routes produce xml error
0%
Description
Hello,
SiteManagement -> Static Routs -> sitemap.xml
I would like the sitemap to be accessible via domain.tld/sitemap.xml, so in the Static Routs I have "sitemap.xml" entered with the type "Page, File or URL" and in the input field: "t3://page?uid=1&type=1533906435" (UID 1 is the DomainRoot - GlobalIcon)
If I call the site now via domain.tld/sitemap.xml the error is that the XML is not correct because it doesn't start at line 1 - but instead it starts at line 2 - therefore its invalid.
Because I call the sitemap over domain.tld/?type=1533906435 OR domain.tld?uid=1&type=1533906435 it works as it should. So the XML tag starts in line 1 ...
Files
Updated by Hannes Strangmeier about 6 years ago
I ran into same behaviour recently.
This can happen if you have unnecessary new lines etc. in your configuration-files, e.g. before the opening php-Tag. Most likely in AdditionalConfiguration.php (or files you require in there).
Also check for control-characters that should not be there (e.g. ^M as a windows-control-character, even though your TYPO3 is running in on a unix-system).
Updated by Christian Hackl about 6 years ago
Hannes Strangmeier wrote:
I ran into same behaviour recently.
This can happen if you have unnecessary new lines etc. in your configuration-files, e.g. before the opening php-Tag. Most likely in AdditionalConfiguration.php (or files you require in there).
Also check for control-characters that should not be there (e.g. ^M as a windows-control-character, even though your TYPO3 is running in on a unix-system).
Oh yes, wtf.
In my case it was a blank first line (befor however, I think this should not cause a corresponding error, or?!
Updated by Hannes Strangmeier about 6 years ago
In at least 7.6 and 8.7 this causes similar behaviours elsewhere, e.g. it would lead to a blank line as output of the scheduler when called on cli (otherwise it would just return an exit code 0).
I never really considered this a bug to be fair, since it's a misconfiguration in my point of view. This being said, in older versions i even had to modify an extension that also had such a blank line before the opening php-tag... but in most cases the realurl_conf.php had a blank line due to copy pasting from the example configs.
Updated by Christian Eßl about 5 years ago
- Category set to Site Handling, Site Sets & Routing
Updated by Tymoteusz Motylewski about 5 years ago
- Status changed from New to Rejected
Not an issue- missconfiguration.