WebBuilder101 - Making the web happen!
Need Web Dev software? Here is the place to
Flash Point
Making your web server parse .html files for SSI code

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.

.

 

More Resources
How to create a text file
Server Side Include
SSI how to.
Naming SSI files
Using SSI in ASP pages
.htaccess and 404 documents

Suggested Reading

Beginning Active Server Pages 3.0
JavaScript Bible
Red Hat Linux
Dreamweaver 3.0
HTML Bible



Download WB101 Wallpaper
• Web Builder 101 Wallpaper Get it!.
• Find out how to create your own Wallpaper Teach me!.
Sign up for our Newsletters
• Web Building Sign me Up!.
• Net Alert! Sign me Up!.
Need Help?
• Contact Support Click here.
• E-mail the Webmaster Click Here.
• Search Tips Click Here.

Webbuilder101.com © 1998 - 2003 Copyright and Terms of Use
Send mail to: webmaster@webbuilder101.com

» About » Support

» FAQ » What's New » MyLog

Web Builder 101 Web Builder 101 - Making the Web Happen Web Builder 101 - Making the Web Happen
.