Re: RSS Generation

From: Date: Mon, 10 Apr 2006 15:17:36 +0000
Subject: Re: RSS Generation
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-233671@lists.php.net to get a copy of this message
> ... When I tried saving it with an xml extension and > adding a .htaccess file to the directory in which the file was saved, I get > prompted to save the file instead of being able to view the file in a > browser. The only line in the .htaccess file is AddType > application/x-httpd-php xml. I had similar problems when trying to roll-my-own RSS feed with php. Michael is right that it doesn't matter what your file extension is (you probably don't even need that htaccess directive) as long as the file is served as XML. Try adding a header at the top of the file: header("Content-type: text/xml; charset=utf-8"); <rss version="2.0"> <channel> ... I also use the Firefox browser which has a built-in XML browser that allows me to do a quick validation of the XML. You can also use www.feedvalidator.org to troubleshoot your feed once its online. - Greg

« previous php.general (#233671) next »