Welcome to WebmasterWorld Guest from 22.214.171.124 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Become a Pro Member
Keyword Based RSS Feed How To Create Keyword Based RSS Feed Erku
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.
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.
Yes, I have search functionality and use php.
Could you please give me some more detailed information as to how to proceed?
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> </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.
Thank you so much. Your exmplaination is very helpful. I greatly appreciate it.