cancel
Showing results for 
Search instead for 
Did you mean: 

SSI on homepages server

N/A

SSI on homepages server

Hi,

I know that SSI (Server Side Includes) are currently only available on crofters (CGI server) but this seems more by default than by design - CGI requires precompiler directives to be enabled.

Would there be any unpleasant implications for F9 if you were to reconfigure the homepages server to send all .htm and .html requests through what Microsoft would call ssinc.dll but whatever the homepages server is running (Apache?) would call something else?

Anyone who's ever built a menu that's used on more than one html page will appreciate the benefit of designing it once and including it (via SSI) on each page that needs it rather than copying the html for the menu into each page and then inevitably forgetting to update one of them when the menu inevitably changes!

Any chance of getting this done :?:
4 REPLIES
Ianwild
Grafter
Posts: 3,835
Registered: 05-04-2007

SSI on homepages server

Hi,

You can already use SSI on the Homepages server (I will also move this to the CGI forum until anyone proves me wrong!)

You need to create a .htaccess file containing:

AddType text/html .shtml
AddHandler server-parsed .shtml

Just place this in your htdocs directory and then any file ending .shtml will be parsed.

The easiest way to create a .htaccess file is to use Notepad on your machine and create a file called htaccess.txt which should just contain the lines as above. Save this and then upload the file using ftp and once it is on the server rename it to .htaccess

Let us know how you get on.

Regards,
N/A

SSI on homepages server

Splendid! Thanks Ian - I was sure I'd read that it wasn't possible to use SSI on homepages - in fact there's a member site ( http://www.sheamus.force9.co.uk/user/ssi.html ) which is very insistent that it's not possible. Ho hum.

So, that's all very nice but the default documents list on homepages doesn't include index.shtml so visitors get a directory listing instead of a homepage when they type the site url with no page specified.

For anyone following this thread there's a simple solution to this - you just need to add the line
DirectoryIndex index.shtml

to the .htaccess file. Your new index page doesn't have to be called index.shtml but mine is!
Ianwild
Grafter
Posts: 3,835
Registered: 05-04-2007

SSI on homepages server

HI,

Pleased this worked for you. You can actually use the same method to parse all normal HTML pages, but this is a very bad idea as it causes significant additional server load and will probably slow down the serving of your pages.

Not sure what we can do about the Seamus site... It isn't ours to edit. I will have an ask around and see if I can get any ideas for this.

Regards,

Ian
N/A

SSI on homepages server

Hi Ian

Thanks for that. My site is just a toy at the moment - I'm a (evil m$) web developer by day so I can get rid of most of my code lust professionally without needing to create a personal super site in my spare time. Nice to fiddle though...
I will probably set .htaccess to parse all my pages because
a) It's what I normally do (everything is .asp, let the server figure out whether there's actually any ASP on the page. Negligible additional load for IIS)
b) I make liberal use of SS Includes
c) The site will get zero traffic so it doesn't matter anyway!
So I will be parsing all .html files. Might even parse .bigjon files, who knows? :twisted:
That's unless you've got any objections - don't want my 2 hits a month (that's me checking it's still there) bringing "homepages" to halt!

Regarding Seamus, I realised after my last post that the polite thing to do would be to contact him directly as he might want to update his site.

Cheers.

Jon.