SSI includes

design

#1

Is there a way to use SSI includes on htm html extensioned pages?

Found a couple of old threads relating to that but the solution doesn’t work.

I have a 10 year old site that doesn’t need php nor do I want to lose my rankings nor load the server needlessly by renaming html pages to php.

here is the old thread solution. http://discussion.dreamhost.com/showthreaded.pl?Cat=0&Board=forum_troubleshooting&Number=48679&page=&view=&sb=&o=&vc=1#Post48679


#2

You have to configure the server to parse files with certain extensions first.

Go to http://httpd.apache.org/docs/

Then choose the link to either 1.3 or 2.0 whichever your machine is using.

Then click on “Server Side Includes” and read the “Configuring your server to permit SSI” section.

:cool: openvein.org -//-


#3

Thanks for your help, I’m fairly new to this.

I created an htaccess file in the directory with the lines

XBitHack on
Options +Includes

and called for the include on the html page by adding

<!#include file=“footer.htm” –> (ignore the underscores)

and made the file executeable as directed but it still doesn’t work.

Am I missing something?


#4

You must use the virtual attribute with a url-path:

:cool: openvein.org -//-


#5

Were you able to get SSIs to work? I added the following lines to a .htaccess in the web root directory, and I get an internal server error.

attempt 1
XBitHack on
set the x bit on the .html file

attempt 2
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

Thanks.


#6

What does the error.log say? Make sure you did not disable read permission on the file. The permissions should be 644 w/o XBitHack or 755 /w XBitHack.

At least on my machine DreamHost already has SSI enabled, XBitHack on as well as parsing .shtml files - which means I don’t have to add anything to .htaccess files. Adding directives to an .htaccess file didn’t cause any server errors for me either.

Try removing the directives altogether and just use a file with an .shtml extension and see if it works. If it doesn’t then you should contact support and ask them to confirm that SSI is already setup in the server configuration.

:cool: openvein.org -//-


#7

Thanks Atropos7. I was able to get SSIs working with .shtml extension without the XBitHack directive in the .htaccess file. I’m not sure why, but whenever I add anything to the .htaccess file, I get an internal server error. I’m not going to worry about it though since SSIs are working. In the end, I think my problem was that I had messed around with the permissions on the file while trying different directives and ended up hosing myself. Once I got the permissions correctly set, SSIs worked.

Thanks again…


#8

I’ve been away for a couple of days and just got back to it.

It’s finally working, thanks so much for your help I believe “file” instead of “virtual” was my initial hangup

Here’s how it’s set up

  1. htaccess file located in the directory containing the html pages (named .htm) with the following two lines

XBitHack on
Options Includes

  1. On the pages I want the includes on they are called for called for by

<!#include virtual=“footer.htm” –> (no underscores)

  1. the file permissions for the pages having includes set at

rwx-rx-rx

that was my last sticking point somehow when I changed the group and other permissions to x the owner was set to rw only, once i corrected that it’s working fine.

the .shtml worked, however my pages have been indexed for many years and have first page placement for several search strings. I’m freshening the site and working on improving placement and wasn’t going to rename my files and start from scratch, to save some time when I update files.

Now I’m a little further along - by the way we have a horsedrawn carriage company. http://loonmeadowfarm.com/


#9

FYI-

I tried putting the include in a separate directory called “includes” which didn’t work, returning

“[an error occurred while processing this directive]”

I tried both a short path virtual="/includes/footer.htm" and the long path virtual=“http://etc…”

then I changed the short path to read virtual="./includes/footer.htm" (adding the dot) and that works.

I don’t understand why the full path wouldn’t work, curious.

Thanks again, maybe this will help someone else out