Project

General

Profile

Actions

Bug #86659

closed

Sitemap with static routes produce xml error

Added by Christian Hackl about 6 years ago. Updated about 5 years ago.

Status:
Rejected
Priority:
Must have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Target version:
-
Start date:
2018-10-15
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
sitemap.xml, static routes
Complexity:
Is Regression:
Sprint Focus:

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

Bildschirmfoto 2018-10-15 um 16.51.15.jpg (30.2 KB) Bildschirmfoto 2018-10-15 um 16.51.15.jpg xml error Christian Hackl, 2018-10-15 16:52
Bildschirmfoto 2018-10-15 um 16.52.13.jpg (18.8 KB) Bildschirmfoto 2018-10-15 um 16.52.13.jpg here you can see the blank line 1 Christian Hackl, 2018-10-15 16:52
Actions #1

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).

Actions #2

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?!

Actions #3

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.

Actions #4

Updated by Christian Eßl about 5 years ago

  • Category set to Site Handling, Site Sets & Routing
Actions #5

Updated by Tymoteusz Motylewski about 5 years ago

  • Status changed from New to Rejected

Not an issue- missconfiguration.

Actions

Also available in: Atom PDF