View Full Version : Please HELP!!! SSI Nightmare

11-02-2007, 05:27 PM

I have an entire site already designed.

I want to go back and add includes for my navigation and footer so I can stop the nightmare of having to update 50 pages for one change to the navigation.

I did a test page with both SSI and PHP includes. They worked. However:

1. In order to work with php, all my pages need a .php extension.

1. In order to work with SSI, all my pages need a .shtml extension.

Like I said--the site is already complete. It would mean a complete overhaul to go and change all the name extensions/associated hyperlinks.

Is there any way to get includes to work on .html and .htm pages?

11-02-2007, 05:35 PM
Yes you can use htaccess. Here is an example for making all pages parse as php

AddType application/x-httpd-php .htm .html
To make all pages be parsed by the server so you can use SSI (the includes you would have used on an .shtml page) you can use this

AddType text/html .shtml .shtm .htm .html
AddHandler server-parsed .shtml .shtm .htm .html
I would like to add though that this was poor design practice. Having that many pages without includes was non sense to begin with. You should think things through before you do them.

11-02-2007, 06:07 PM
I would venture a guess that each of your 50 pages are almost identical and only differ in the content that is on each page?

If so, this is an ideal candidate for having one page of code using php and simply displaying the different content by having php populate it from a database depending on what navigation link is selected.

If you are going to go through the trouble of modifying each page to change headers, footers, and navigation to use includes, why not put that same amount of effort and time (or it could actually be less) into reducing it to one page with the different content for each page being stored in a database.

If this is something like repetitive product or any other repetitive information display, you will end up saving yourself a lot of time long term by doing it this way.