My Internet Stuff

How to Create a RSS Feed for Your Website?

January 18, 2009 · 8 Comments

I know nowadays many blog software and websites have built-in atom/rss feed; but I have a BANS site which did not provide neither atom nor rss feed. So I want to build one that visitors can subscribe or bookmark my site.

In order to build one, I found out that I have to create a rss.xml file and upload it to my BANS directory in my web server.  You can name whatever name you preferred to that file. I then put the following format in that file and save it. See below:

<?xml version=”1.0″ encoding=”ISO-8859-1″ ?>
<rss version=”0.91″>
<channel>
<title>Name Your Feed Here</title>
<link>http://www.yourdomainname.com</link>
<description>Description of Your Feed Goes Here</description>
<language>en-us</language>
<item>
<title>Article Title Goes Here</title>
<description>Description of Your Article Goes Here</description>
<link>http://ww.yourdomainname.com/Article’s Permalink Goes Here</link>
</channel>
</rss>

This is only one item feed; meaning you only have one article in it. If you want to have more items, you can add more. Make sure you change the red color parts to suit your needs.

After that you can check it out from a feed validator to see whether it is a validated feed or not. Just type your website’s url in the text field. If no errors, then you’ve just created a validated feed for your website. Not quite! You still need to present it on your web page so that people can react with it.

How can you implement a rss feed to your web page?

Here is how:   You need to save an icon either looks like xml or rss in your images folder on your server. Then put the following codes in your header of your website (mostly an index.php file or a header.php file):

<a href=”http://www.yourdomainname.com/rss.xml” title=”Subscribe to my feed” rel=”alternate” type=”application/rss+xml”><img src=”http://www.yourdomainname.com/images/rss.png” alt=”RSS feed” style=”border:0″/></a> <a href=”http://www.yourdomainname.com” title=”Subscribe to my feed” rel=”alternate” type=”application/rss+xml”>Subscribe in a reader</a>

It will show up on your website like this: rss Subscribe in a reader. Make sure you change the red color of the codes to your own domain name and whatever file name you’ve given to your icon image. Good luck!

my_signature

Categories: Blogging Tips · How To
Tagged: , ,

8 responses so far ↓

Leave a Comment