There are lots of images on this page please wait for them to download.

Login to use the RSS Reader

How to Add PHP RSS Feeds to Your Web Pages

RSS in Javascript format is readily available from most RSS Publishers but what they do not tell you is that Javascript is not search engine friendly. What that means is search engines do not read Javascript. Any thing placed on your web pages in javascript format will not be read by the indexing search engines. That is why we offer our feeds in PHP. PHP is a search engine friendly scripting language. Adding RSS feeds to your web pages with PHP will provide fresh content for the search engines to pick up and rank you for.

As a webmaster you would interested in having search engine friendly RSS feeds on your web pages because this can help with;

  • Getting spidered more often
  • Ranking higher in the search engines
  • Adding Relevancy to your web page.

PHP is server side scripting. That means it is parsed on the server before your page loads in the browser. To the visitor and to the search engines PHP scripts are not noticeable. When PHP is combined with RSS feeds it is a pretty powerful concept. With PHP and RSS you can add other people's content to your web pages and the search engines will see it and think it is part of your website! That free RSS content when placed on your web page with PHP will essentially become a part of your web site and bring you more traffic. That is why we recommend that you add the feeds to your website with PHP instead of Javascript. Follow the instructions below to add the code to your web pages.


#1 Instructions for adding PHP code to an HTML site;

PHP scripts do not automatically work on html pages. If you have an HTML or (.HTM) based site, in order for PHP scripts to run on your .htm or .html pages you have a 2 options;

  1. For Apache Servers Edit your .htacess with AddType application/x-httpd-php .htm .html Then Add the php code from the reader directly to your html pages

  2. For Apache Servers Edit your .htacess with either .htm server parsed .html server parsed or
    Addhandler application/x-httpd-php .html .php
    Then follow the directions below to use the php code from the reader with SSI Includes.

***NOTE: For Windows or IIS servers - You do not have an .htaccess file. Windows IIS servers also cannot run php on html pages. Your only option for windows IIS servers is to use .shtml or .php pages with the php option from the reader. Or add Javascript to your html pages. For .shtml pages check your setup options and make sure the option for SSI inlcudes is checked, then follow the directions below for creating the SSI include and file.


SSI Includes

SSI includes are short commands that reference another file on your server for inclusion on the web page where it is called from. Meaning you can put any information in an external file and remotely call it into any other page on your server with an SSI command. This is especially useful for making the task of editing large websites easier. When the file that is being included is changed, all of the pages that reference that file will change at the same time, without you having to change them all one by one.

SSI is also useful for parsing PHP scripts into .html or .htm webpages, since PHP by itself does not work on html sites. PHP code works on pages that have a .php extension. But instead of changing all of your webpages from .html or .htm to .php extensions, you can use SSI on your html pages.

Follow these instructions below to use SSI Includes with RSS feeds on your .html or .htm website.

1. Open a plain text editor like Notepador Textpad and create a new file, then name it rssfeeds.php (This is an example file name, You can actually name this file anything you'd like)

Add the PHP code that was given to you by the RSS reader in to the blank rssfeeds.php file and save it in your root folder and upload it to your server. There should nothing else in the file except the code that was given to you by the reader.

Here is an Example rssfeeds.php file;


Next add this SSI call to your web pages where ever you want to display RSS headlines.

<!--#include virtual="/rssfeeds.php" -->


In order for a .html or .htm site to parse a PHP script on it's pages, you need to have some instructions in your website's .htaccess file. (For this step you will need access to the .htaccess file on your server.)

You can either manually modify the .htaccess file on your server, or if you have Cpanel, this can very easily be done using the 'Apache Handler' Function. Look for the 'Apache Handler' Icon in Cpanel and click on it.


After you click on the Apache Handlers Icon you will see a screen similar to this one below

In the example above there are no instructions for .htm and .html pages. If your Apache form looks like the above then proceed as directed below. If there are instructions already listed under "User Defined Handlers" for .html and .htm extensions then you do not need to modify anything at all.


Next we need to add the instructions ...

.htm server parsed

.html server parsed

Type .htm server parsed in as directed in the picture below, then click on the "Add" button;


You will be instructed that your definitions were assigned to the extensions specified on the next screen.



Click on Go Back and you will see the definition you just added defined under "User Defined Handlers" as demonstrated in the picture below



Repeat the steps above with the extension .html



Click on "Add"



That is it, you have just modifed your .htaccess file to parse .html pages and .htm pages on the server. Visit your web page to see if your feeds are running. If you want the feeds on each page of your website just add the same SSI include to each page. If you add the SSI inlcude to pages in another directory be sure to correct the path to the rssfeeds.php file on your server.

There is no need to create a new rssfeeds.php file for each page unless you are running a different RSS feed (on a different topic) on each page.

If you cannot use "Apache Handler" or if you do not have Cpanel you can manually modify the .htaccess file by adding these two lines below;

.htm server parsed

.html server parsed


If the above does not work you can try adding this line below, which does the same as the two lines above.

Addhandler application/x-httpd-php .html .php


#2 Instructions for adding PHP code to a PHP site;

For a PHP based website, you simply add the PHP code produced by the RSS Reader directly to your PHP pages. Do not modify it in any way. Add the PHP code to the web page anywhere that you want to display the headlines. You may add it to as many pages on your site as warranted.

Do NOT modify your .htaccess file for PHP pages.


#3 Instructions for adding PHP code to a SHTML site;

For a SHTML based site (only do this if it's SHTML), you should add the following SSI code to your pages where ever you want the headlines to appear.

<!--#include virtual="/rssfeeds.php" -->

Then use notepad to create a file on your server called rssfeeds.php and copy the PHP code produced by the RSS Reader into that blank file and save it to your root folder.


Here is an Example rssfeeds.php file;


That is it!

You do not need to modify your .htaccess file for SHTML pages.



Contact Us for Support | Login to use the RSS Reader