How to add PHP script to HTML without renaming .html page to .php?

Alton J. Jones

New member
I want to add .php script to my existing .html pages for RSS feeds. Is there a way to add PHP into the HTML script without changing the web pages extension to .php?

How will browers find these existing pages on the site if they all had to be renamed .php? If they search for my page using an html extension, wouldn't they receive a "page not found" message?

My hosting service (Network Solutions) uses Unix and when I upload files, I place them in a folder called "/htdocs" rather than a folder called "/htaccess". Network Solutions does accept php code and from my understanding, "parsing" is not required.
 
Go to your "/htdocs" directory and look for the file named .htaccess.

If it's not there, create a blank page using NotePad or Dreamweaver and save it as .htaccess

Now edit this file by adding the following lines:

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

Save and close the .htaccess file. Upload it to your "/htdocs" folder.

Now PHP will handle your html pages without having to rename them to .php
 
Back
Top