I have a site that I designed where all the pages are html, it started out real small, where I could easily go to each individual page and update menus, but now has a decent amount of pages, too many to update. I now would like to re-design the site using SSI to upadate menus on everypage with only 1 edit. I know how to do this in PHP but this site already is established and has links pointing back to .html pages. So my question is how do I design this site so that all of the pages remain .html but allow me to do SSI as well. If you have a link to a good tutorial I would love to have that as well. Any help is appreciated. Thanks
Not sure on this. I had a discussion with my friend in school about this subject. I think you use the .htaccess file so you can rewrite the url so it still has a .html or .htm extension. Hope this helps ~eric
SSi is pretty limited and will require your page to be renamed. If your server has php you can add a handler to the .htaccess file to parse html pages as php. You can then use php includes to include as many parts as you want and you do not lose any back-links as your pages retain the html extension. On most of my sites I have one header, footer, navigation and ads page included in all the other pages. An example page with more details. Ask any follow-up questions in this thread and I will try to answer.
The result is what you said but it is not a rewrite funtion. What you are doing is telling Apache that html pages are to be treated as if they are php. The actual code that does it is: AddHandler application/x-httpd-php .html PHP:
That is all it takes to parse html pages like they are php. A lot of sites don't even have a .htaccess file. There are a lot of other things that might be put in one like: 301 and 302 redirects mod rewrite functions allow deny commands to ban ips or countries. On many systems you can control certain aspects of PHP if override_allowed is set to on in the master config file. Stuff like register_globals off on, memory and post sizes etc.
As Colbyt says you just need to change your .htaccess file to something like check with your host though and let them know what you want to do as some servers need , but some need and hosts also have different verions of php on them. after your server is set to allow your html pages to work with php you can make calls to your SSI pages, the code for that is (or .html or .php whatever the extension)