Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
Thread: Please HELP!!! SSI Nightmare
11-02-2007, 05:27 PM #1
- Join Date
- Oct 2007
- Thanked 0 Times in 0 Posts
Please HELP!!! SSI Nightmare
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 #2
- Join Date
- Dec 2004
- In a place far, far away...
- Thanked 1,043 Times in 1,019 Posts
Yes you can use htaccess. Here is an example for making all pages parse as php
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 thisCode:AddType application/x-httpd-php .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.Code:AddType text/html .shtml .shtm .htm .html AddHandler server-parsed .shtml .shtm .htm .html
11-02-2007, 06:07 PM #3
- Join Date
- Oct 2006
- Denver, Colorado USA
- Thanked 333 Times in 325 Posts
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.
If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.