|
By Eddy R.
5-01-00
If you are thinking about using SSI on web pages that have the
.html extension then you are in trouble. For SSI to work,
a file must end either with the .shtml extension or the .asp
extension so that the server may parse such file(s) for SSI code.
The way I see it, you have two options - that is if you are determined
to use SSI on your web pages: Rename all of your files from .html
to .shtml/Asp, or use the .htaccess file.
Renaming files
Renaming your files isn't much of a problem if you only have a
few web documents, but if you have 500 or even 100 documents, then
renaming is definitely out of the question. Why? Well, think of
what you are going to have to go through - that is actually renaming
the files and updating all of your links (this is the worst part).
Yes it's true that there are tools out there - such as Dreamweaver,
that will help you rename files and update links automatically,
unfortunately those tools aren't always accurate and figuring out
what went wrong takes a really long time - not to mention the time
it takes to actually fix whatever problem(s) you may find!
Using .htaccess
The best solution to your problem would be to use the .htaccess
file. Here is how to do it.
-
Fire up your text editor and create a file named htaccess.txt
-
Place the following code inside the file: AddType text/x-server-parsed-html
.html (hit Return/Enter at the end of the line).
-
Save and upload the file to your server - upload it to all
the directories that will have documents using SSI
-
Rename the htaccess.txt file to .htaccess - when you do this
you won't be able to see the file anymore since it will become
a hidden file.
That's it! Now your web server will parse .html files for
SSI code.
Note: Keep in mind that this may not work on all web servers
as their setup varies from server to server (some Server Administrators
do not allow you to modify the .htaccess file for security
and many other reasons).
If the .htaccess file doesn't work on your server, ask your Server
Admin to enable .htaccess.
|