Olaf
Olaf

Reputation: 10247

php-created rss feed has encoding errors since on new server

After moving a website from one webserver (Apache 1.3) to another (Apache 2.0 at domainfactory), the W3C feed validator says the feed is correct but has two problems:

  1. Feeds should not be served with the "text/plain" media type
  2. Your feed appears to be encoded as "ISO-8859-1", but your server is reporting "US-ASCII" php-created rss feed

The help link didn't help.

Firefox and Chrome show the source code instead of the nice feed view (other feeds are shown correctly).

We are using php 5.3.6 to generate the feed: http://www.stuttmann-karikaturen.de/feed.rss. It's generated as a file, not on-the-fly.

We have tried adding (alternatively) the following lines to .htaccess:

No change. Any ideas?


Kwebbles answer did it for me. In case someone has a similar problem, here's the correct AddType line that worked:

AddType text/xml;charset=iso-8859-1 rss

Upvotes: 1

Views: 521

Answers (2)

Kirk Strobeck
Kirk Strobeck

Reputation: 18559

Don't use .htaccess, use a PHP header to make those settings.

Upvotes: 0

Kwebble
Kwebble

Reputation: 2075

If the extension of the resource is .rss I think the AddType directives should also use that.

Upvotes: 2

Related Questions