|
|
Enable SSI with .htaccessThere are quite a few functions you can enable by adding SSI to your server. Usually you have to use .shtml to enable these functions. This activates the posibility to include a file in another, banners, and some other functios. Before I started using a CMS, and sometimes even now too, I used SSI to be able to include a file within another. Huh? Imagine you create a website with 100 pages. Imagine you misspelled something in your header or wish to change your logo dimensions. With SSI you can create 1 file with only your header information and have that file included in all documents. This way, if you need to change it the header, you don't have to change 100 .html files, but just 1. Same applies to footer and menus. Say you have a really cool menu. Its on every page of course. Suddenly you want to add an option to that menu. Do you have to go and change every page in your site? Not any more. Have just one file with that cool menu and have it included in all pages. This way you just modify one menu.html file and all pages change automaticly. So how does it work? First lets activate SSI adding the following line to your .htaccess like this:
As an option, you may add the other common file types:
The above lines tell the Apache Web Server to allow "Server Side Includes" in documents with the file extension '.html', '.shtml' and '.htm'. Cool. Now what? Now you should "include" the file or information you want to include. These are two samples on how to do it:
The above line would execute your cgi script located in your cgi-bin directory and show the result output on the page as if it were one more element.
The above sample includes the file named document.html located in directory called /directory/ into the current page. May not be http://www.domain.com/directory/document.html. Review It
|
|
||||||||||