homepage Welcome to WebmasterWorld Guest from 54.243.17.133
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
Forum Library, Charter, Moderators: bill & werty

RSS, ATOM, and Related Technologies Forum

    
Is your feed really valid?
only if it is defined as a application/rss+xml mime-type, it is.
sidyadav




msg:1542463
 1:07 am on Apr 10, 2004 (gmt 0)

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:
Warning
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

Sid

[edited by: Brett_Tabke at 1:29 am (utc) on April 15, 2004]
[edit reason] fixed link [/edit]

 

Tippy




msg:1542464
 10:58 am on Apr 12, 2004 (gmt 0)

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

header("Content-type: application/rss+xml");

(or /atom+xml, delete as appropriate) and it ought to pass the new validation requirements.

Cheers,
Scott

Visit Thailand




msg:1542465
 12:28 am on Apr 14, 2004 (gmt 0)

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!

sidyadav




msg:1542466
 2:50 am on Apr 14, 2004 (gmt 0)

As the great Andrew Martin [imdb.com] said, "One is glad to be of service." ;)

Sid

King of Bling




msg:1542467
 3:20 pm on Apr 14, 2004 (gmt 0)

Hey, I was just trying to figure that one out. Added your code - and whammo - validation!

Thanks!

Visit Thailand




msg:1542468
 12:36 am on Apr 15, 2004 (gmt 0)

Unfortunately I still get the same message.

Do I have to add something to httpd?

sidyadav




msg:1542469
 1:21 am on Apr 15, 2004 (gmt 0)

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>
    ForceType application/rss+xml
    </Files>

    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.

    Good luck,
    Sid

  • ronin




    msg:1542470
     11:41 pm on Apr 18, 2004 (gmt 0)

    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.

    ronin




    msg:1542471
     3:31 pm on Apr 23, 2004 (gmt 0)

    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?

    hans51




    msg:1542472
     8:35 pm on Apr 26, 2004 (gmt 0)

    .htaccess
    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
    name .htaccess
    content on a single line
    AddType application/rss+xml .rss
    upload ftp in ASCII!
    chmod 664

    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

    [kriyayoga.com...]

    ronin




    msg:1542473
     10:28 pm on Apr 26, 2004 (gmt 0)

    Okay, thanks for that, Hans.
    So what do you do istead of .htaccess if your server is a windows server?

    PeterD




    msg:1542474
     3:32 am on Apr 27, 2004 (gmt 0)

    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.

    ronin




    msg:1542475
     5:17 pm on Apr 29, 2004 (gmt 0)

    I'd love to hear it if you find it.
    I've run a couple of searches but no luck.

    XMLMania




    msg:1542476
     5:33 pm on Apr 30, 2004 (gmt 0)

    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.

    Global Options:
     top home search open messages active posts  
     

    Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
    rss feed

    All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
    Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
    WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
    © Webmaster World 1996-2014 all rights reserved