Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    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?

  2. #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    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
    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.

  3. #3
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Denver, Colorado USA
    Thanked 511 Times in 499 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.
    Finding out HOW to do something is called research, i.e. keep searching until you find the answer. After you attempt to do something and cannot solve a problem with it yourself, would be when you ask others for help.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts