|Is your feed really valid?|
only if it is defined as a application/rss+xml mime-type, it is.
The Feed Validator [feedvalidator.com] has just added a new specification:
Any .rss file, which is used as a feed, needs to be parsed as a "application/rss+xml" mime-type through the system, to be known as "fully" valid.
Without this, your RSS is of course, valid, but some systems/programs may have some problems:
This feed is valid, but may cause problems for some users. We recommend fixing these problems.
Feeds should not be served with the 'text/plain' media type [help [feedvalidator.org]]
To fix this, simply add the following code to your .htaccess file:
|AddType application/rss+xml .rss |
[edited by: Brett_Tabke at 1:29 am (utc) on April 15, 2004]
[edit reason] fixed link [/edit]
If you're generating your rss dynamically with PHP while using a shared hosting package you may be having difficulties fighting around configurations issues. PHP has a useful function which will help if you're forced to use a .php extension for your feed, which will in all likelihood serve it as plain text.
Add this as the first line of your script
(or /atom+xml, delete as appropriate) and it ought to pass the new validation requirements.
sid - thanks for that I was just about to post asking how to solve this problem that has been bugging me for a few days. Their FAQ should link to this thread!
As the great Andrew Martin [imdb.com] said, "One is glad to be of service." ;)
|King of Bling|
Hey, I was just trying to figure that one out. Added your code - and whammo - validation!
Unfortunately I still get the same message.
Do I have to add something to httpd?
Visit_Thailand, you can try the following options:
Add the same .htaccess code given above, to your httpd.conf file.
Add the following code to your .htaccess file, modifying the bold/italics/red bit:
|<Files your-feed-name.rss> |
the code above is more precise, and doesn't parse all the other rss files on your server but the one listed after <Files. I would recommend adding the AddType code first in your httpd.conf file, with this being an alternative.
Hmmm... this .htaccess stuff - does this only apply to Apache Servers or to Windows Servers as well?
Every time I've tried to create an .htaccess file in the past the windows server seems to have just stared at it blankly and walked on.
Quite frankly I don't understand anything about .htaccess or server side stuff.
Can't I just define my RSS 2.0 document as application/rss+xml mime-type within the document itself?
is for apache server
and hence for all unix, linux freebsd, etc server
that make the vast majority of all heavy duty hosts on the web.
the regular line added to have all .rss files served properly would be
AddType application/rss+xml .rss
LL files on your domain that are in the folder AND any of its SUB-folders of that .htaccess file.
it is enough to put that line into the .htaccess of the ONE folder you store all .rss feeds since it normally never is used escept for .rss files and if applied system wide may delay apache server a little for each page call.
if you have NO .htaccess file there ( and your site is running an apache server )
then you may create a .htaccess file and upload it into the folder containing your .rss files
use a regular unix editor on you linux system ( or whatever -ix system you have )
an empty text file
content on a single line
AddType application/rss+xml .rss
upload ftp in ASCII!
and that error message should disappear because it menat that your server did serve the rss files as text/html files due to missing above LINE in .htaccess OR apache httpd.conf
by that additional line apache will handle the file differently when "serving" files with that extension .rss
.htaccess usually can be created/configured by any site
owner using a regular commercial domain host service.
apache is looking by default in every folder for a .htaccess
for any further problems or a full RSS howto for beginners you may want refer to
Okay, thanks for that, Hans.
So what do you do istead of .htaccess if your server is a windows server?
I just want to pop in to say that I used the method sidyadav recommended, adding the Force Type statement to my .htaccess file, and it worked perfectly.
ronin, I remember reading somewhere--right after the validator got picky about mime-type--that there was a statement you could add as the first line of your feed that would correct the mime-type. Apparently, it would be interpreted as part of the header. I just cant't find it, though!
Obviously, this is a problem for people on shared hosting, or who can't easliy re-configure their servers.
I'd love to hear it if you find it.
I've run a couple of searches but no luck.
I output feeds with the "text/xml" mime-type.
They are all based on the common XML format. Just imagine, all the thousands of different XML standards out there having individual mime-types.