Support » Fixing WordPress » RSS 2.0 feed sends content as text/html instead of text/xml

  • Resolved sairuh



    I’ve noticed that my RSS 2.0 feed (below) is sending out content as text/html rather than text/xml:

    Why is that, and how would I fix it so that it sends text/xml instead? My wp-rss2.php file sets the content as text/xml in the header, so I’m not sure what’s causing the problem.

    I have also tried adding “AddType text/xml .rss” (no quotes) to the .htaccess, but that didn’t work either.

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Should clarify why the text/html is a problem (in addition to causing a warning in feed validation): some readers of my blog aren’t able to read articles with their rss clients (e.g., sitescooper) because of the incorrect content-type.

    Other than using a 3rd party feed service like Feedburner, is there a way to make the content-type actually resolve as text/xml? For example, so that the feed URL points to something like an .xml or .rss file (e.g., index.xml)?




    Looking at the headers it seems very likely that you are doing no-www or something in your .htaccess .

    $ lynx -dump -head
    HTTP/1.1 301 Moved Permanently

    That is why the mime type is text/html , that is as expected.

    $ lynx -dump -head | grep -i content-type
    Content-Type: text/xml; charset=UTF-8

    So in closing is not the address of your feed, is.

    Ah, so the redirect from www to the non-www version causes the resulting content to be text/html. Hadn’t realized that. Fwiw, I use a URL rewrite rule for that redirect in my .htaccess –but I admit I’m not familiar enough with Apache inner-workings to understand why it behaves the way it does.

    At first I thought the wrong content-type might’ve been due to a plugin conflict, but testing with all of them off (and turning them on one by one) didn’t seem to resolve the original problem. I also had wondered if it was the mysteriously erratic issue mentioned in the “Feeds not served as xml” forum thread.

    In any case, thanks for the explanation! When I distribute my feed link, I’ll make sure to use the proper form of the URL.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘RSS 2.0 feed sends content as text/html instead of text/xml’ is closed to new replies.