homepage Welcome to WebmasterWorld Guest from
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

Keyword Based RSS Feed
How To Create Keyword Based RSS Feed

 1:02 pm on May 6, 2006 (gmt 0)

Hey fellows,

I would like to ask how to create an ability to generate RSS feeds by keyword?

My site currently generates RSS Feeds by categories. How can I do it by Keyword?

If you can please give more details.

Thank you very much.



 1:35 pm on May 6, 2006 (gmt 0)

do you have a search function on your website? If you do then it may be possible to modify the output to produce a layout that is based on an rss file.

You could then create a file called foo.rss or whatever and configure your server via htaccess to handle the file as .php then use a php include to include the search results page search.php?query=whatever

This is assuming you use php. Any other scripting language should be able to do the same.



 5:05 pm on May 6, 2006 (gmt 0)

Hi Mack,

Yes, I have search functionality and use php.

Could you please give me some more detailed information as to how to proceed?

Thank you.


 7:03 pm on May 7, 2006 (gmt 0)

What I would do is create a clone of the file that handles the actual search (for example search.php) and create a version of it using a very simple template. call it search2.php

What you would be looking for is something like

<title>result title</title>
<description>your description</description>
<url>the result url</url>

for each individual result. You should be able to do this by editing your search scripts template file or the actual code within your search script file.

Then create a script to call the result page. Call it something like queryfeed.php

<?xml version="1.0" encoding="iso-8859-1"?>
include "search2.php?query=$q";

How what you will have is a php page that outputs rss when a query is sent within the url. For example example.com/queryfeed?q=test

You now need to set up apache to handle this file. Rename queryfeed.php to queryfeed.rss

Because it is no longer an php file it will no longer work. what you need to do is add an entry to your htaccess to allow the rss file to be handles in the same way as php.

create a .htaccess file in the directory that holds your queryfeed.rss file and place the following code within in.

<Files queryfeed.rss>
ForceType application/x-httpd-php

Hope this helps.



 11:37 am on May 9, 2006 (gmt 0)

Thank you so much. Your exmplaination is very helpful. I greatly appreciate it.

Best wishes.

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