PDA

View Full Version : Server Side Includes not working


monker7
01-01-2007, 10:18 AM
Hi, I'm new to hostmonster, been using Godaddy for a few years but thought I'd try the unlimited domain hosting here. I just put up the first page of my new site here and the SSI's aren't working. I'm using the same basic code that I used with Godaddy.

<!--#include virtual="bottom2.html"-->

I tried adding the folder path names but still no good. I tried to send a email to hostmonster but I couldn't get that to work either.

Any ideas?

McCoy
01-01-2007, 12:09 PM
Your files need to have the extension .shtml if you want them to be parsed.

monker7
01-01-2007, 06:09 PM
Thanks McCoy that did the trick. Godaddy didn't require that for some reason. Learn something every day. Thanks again.

linFox
01-03-2007, 06:21 AM
Most likely GoDaddy had .html handled as SSI, just like .shtml

Go to the Apache Handlers option in cPanel and add the extension '.html' with the handler 'server-parsed' (just like the .shtml entry you can see on the page)

That ought to get SSI working on .html pages.

McCoy
01-03-2007, 09:47 AM
If you're going to use SSI in all your pages that's OK, but otherwise it's really unefficient, as Apache is going to parse ALL your pages searching for SSI, even if the page doesn't have it, which burdens the server unnecessary. By indicating Apache to parse only files which actually have SSI inside you're helping Apache :)

GridTrader
09-16-2007, 08:49 PM
...By indicating Apache to parse only files which actually have SSI inside you're helping Apache :)
How does one do that? I don't want to burden the server. I use server includes quite frequently, as it helps the process of changing mutiple pages, headers, etc, in one easy page edit.

sdasevne
09-16-2007, 09:49 PM
I generate my pages with FrontPage, then upload them with FTP so that I don't need FrontPage Extensions installed. This line in my html, generated by FrontPage, seems to work: <!--webbot bot="Include" U-Include="footer.htm" TAG="BODY" startspan -->

It somehow includes the "footer.htm" file on every page that has the "bot=include" statement. I was having so many problems with the Extensions (which are now unsupported and likely to be dropped) that I gave up on them and don't use any FrontPage functions that require them, including "publishing" to the server; I don't even install them anymore on my new domains.

TCLynx
01-08-2008, 04:19 PM
I am able to get the include tag to work within the main directory but I can't figure out how to get it to work for the subdirectories. I already have the shtml extention applied but for some reason I can't find the right way to indicate where the file I want to include is located if it isn't in the same directory.

Help I'm running out of patients and my searching isn't turning up anything that works. I don't really want to copy the file into each directory, that kinda negates it's usefulness.

EasyCall
01-08-2008, 09:47 PM
For sub directories, put ../ in front of the file name.

TCLynx
01-09-2008, 08:29 AM
EasyCall, I've tried that, it didn't work. That is also what their chat support told me to do and when it didn't work, they finally told me to turn in a ticket. Hopefully I hear back from them soon.

TCLynx
01-11-2008, 08:36 AM
I finally found some one on their chat help who answered my question (though the answer is kinda a bummer)
Anyway, they never responded to the ticket but here is what I found out.

The problem is that I am using sub domains. You can't go up a directory from a sub domain because it is concidered it's own root directory. So if I want to use server side includes and use the sub directories, I need to put the include files in each sub directory.

<Mind churning to see if there might be some other type of work around to deal with this>

r2b2
01-12-2008, 02:40 AM
You could use symbolic links - this allows you to have a directory/filename that points to another "real" directory/file somewhere else.

Not sure if you can do it without SSH though so not sure if thats a problem for you? (i.e. not sure if you can do it via the CPanel File Manager)

TCLynx
01-13-2008, 06:49 PM
r2b2, sort of a shortcut directory what you mean? I don't know if that works with cpanel. Will have to see if I can figure it out.

r2b2
01-13-2008, 07:42 PM
Kind of ... see here (http://en.wikipedia.org/wiki/Symbolic_link) for a very...ummm...technical explanation :D