Welcome to WebmasterWorld Guest from 54.167.110.211

Forum Moderators: bill & werty

Message Too Old, No Replies

Keyword Based RSS Feed

How To Create Keyword Based RSS Feed

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 26, 2004
posts:1012
votes: 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)

Moderator from GB 

WebmasterWorld Administrator mack is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:June 15, 2001
posts:7564
votes: 4


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.

Mack.

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 26, 2004
posts:1012
votes: 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.
Erku

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

Moderator from GB 

WebmasterWorld Administrator mack is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:June 15, 2001
posts:7564
votes: 4


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

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

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"?>
<?php
include "search2.php?query=$q";
?>
</channel>
</rss>

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
</Files>

Hope this helps.

Mack.

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 26, 2004
posts:1012
votes: 0


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

Best wishes.
Erku

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members