Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2024-07-27 17:17:12

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 187
Website

Malformed response header of Txp-generated xml for sitemap

I’ve got Txp generating an xml sitemap for my site. Google and Bing seem to be happy with the sitemap, but when I open the page with Firefox or Opera so I can do a visual sanity check, the content is not recognized as xml and displays as unformatted text with all the xml tags removed. The Firefox developer tools highlight the initial <?xml> tag in error pink. On the other hand, an xml file served directly (sitemap_index.xml) looks fine in either browser. When I look at the headers, the only possibly relevant difference I see is that the Txp-created content has the response header entry content-length: 0. content-length is completely missing from the directly served file. Is this the issue, or is it something else?

Last edited by skewray (2024-07-27 17:17:57)

Offline

#2 2024-07-27 21:49:46

etc
Developer
Registered: 2010-11-11
Posts: 5,133
Website GitHub

Re: Malformed response header of Txp-generated xml for sitemap

If you mean www.skewray.com/sitemap.xml, it is served as text/html. How do you construct it?

Offline

#3 2024-07-28 15:30:51

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 187
Website

Re: Malformed response header of Txp-generated xml for sitemap

I don’t see the text/html in Firefox web developer tools (I am noob-level on this tool), but that would explain it. I made a Txp section (“sitemap”) with no articles and a matching page that spews the raw xml. .htaccess directs site.com/sitemap.xml to site.com/sitemap. How do I change the mime type to text/xml? Is that a php thing?

Last edited by skewray (2024-07-28 15:31:25)

Offline

#4 2024-07-28 15:40:42

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,071
Website GitHub Mastodon Twitter

Re: Malformed response header of Txp-generated xml for sitemap

skewray wrote #337487:

I don’t see the text/html in Firefox web developer tools (I am noob-level on this tool), but that would explain it. I made a Txp section (“sitemap”) with no articles and a matching page that spews the raw xml. .htaccess directs site.com/sitemap.xml to site.com/sitemap. How do I change the mime type to text/xml? Is that a php thing?

Hi
this is how we do it in our site with a small addition to the htaccess.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2024-07-28 15:51:26

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 187
Website

Re: Malformed response header of Txp-generated xml for sitemap

Aha… <txp:header> is the secret sauce. Works now. Thank you!

Last edited by skewray (2024-07-28 15:51:41)

Offline

Board footer

Powered by FluxBB