cancel
Showing results for 
Search instead for 
Did you mean: 

Easy SSI

N/A

Easy SSI

I am usually impressed with Plusnet support but recent attempts to get SSI (Server Side Includes) working on my www server has been a pain. I have been given some very poor advice from Support which has resulted in a huge amount of wasted time. I am posting this just in case it helps other users. I got running by reading other posts on this excellent forum site. Sorry I have not specified the authors of the posts I have used to create this crib.

If you want to use SSI's on the www server;
- don't belive anyone in Support that says this is not possible. I have this in writing. It is. You do not have to mess with the cgi server.
- create an .htaccess file (search this forum site for more information if you don't know about them), and include the following;

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

- If your "index" [default] page requires SSI's [index.shtml] you'll also need to put this line in the .htaccess file, otherwise it will create a server error [as you will not have an index .htm or .html index page for the server to open];

DirectoryIndex index.shtml

- Do NOT HAVE EITHER OF THESE LINES in your .htaccess file, [I was told by Support, at different times, to use these, but don't do it!] otherwise a server error will occur;

Options Indexes FollowSymLinks Includes
Options +Includes


------------------
This is my .htaccess file in all its simplicity;

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

Put it in the /htdocs/ folder on the www server (or in the sub-folder that needs SSI support) and don't forget to load the SSI files (text files) as ASCII, not binary. Recommend that you CHMOD the .htaccess file to 644 for security.

The information above assumes that your pages have .shtml extensions. It is possible to make the server parse any page to include SSI support. If your pages are .html [or htm] but require SSI's use;

AddHandler server-parsed .html
or
AddHandler server-parsed .htm

Beware that this will add some server overhead as then all your pages will be parsed whether or not they have any SSI's. This will take longer for the server to display your pages as a result.

------------------
Another tip, if you cannot see the .htaccess file when you load it to your site (like me) look at the options in your ftp client and there will be an option to add this parameter to the LIST command

-al (minus sign and al)

It may not be easy to find in the Options of your client but it is certainly available in Ws_FTP and FTP-Voyager (available from Plusnet files archive).

Hope it helps
11 REPLIES
N/A

Easy SSI

Thanks for that. It's just what I've been trying to do now for ages. I too have not been impressed with plusnet support regarding SSI, which is a shame as they've normally been so good.
N/A

Re: Easy SSI

Just a thank you note for steveandjoanna about the advice given for setting up an SSI under PlusNet.

If your server side include isn't working, follow this advice - it will really sort out a non-included SSI!

In my particular case an .shtml file was running but the include wasn't being included - viewing the source of the page in the browser showed that the raw include <!--#include virtual="/includes/menu.txt" --> was still present as a comment.

I copied & pasted steveandjoanna's .htaccess file, uploaded it and the server side include worked immediately. Thank You!
N/A

Re: Easy SSI

...a little appendix to my earlier post. The account in question runs two sites, both in separate folders in the htdocs directory, please be advised that if you amend the .htaccess file as above you'll be changing the file which automatically loads as your homepage.

The site I needed to run the include has index.shtml as it's new homepage whereas the second site retains it's older index.htm - so on entering www.mysecondsite.co.uk (this isn't the actual domain) I was presented with a directory list of files. www.mysecondsite.co.uk/index.htm resolved correctly however the webserver, through the upload of the new .htaccess file, had been instructed to look for and load index.shtml

Simply changing the name of index.htm to index.shtml did the trick.

Steve.
N/A

shtml index

Thanks

that does it.

BTW as far as I can see the PN server does NOT offer the Options command.. thougts?

John
N/A

Easy SSI

Yes, but how do you include a ccgi.somename.plus.com file in an ordinary (s)html file on your normal server www.somename.plus.com? I have one file I want to include some perl output in and it is inconvenient to move just that file to the ccgi server.
N/A

almost there

Hello,

This advice is great, but Im still having problems running some SSI script.

I am having the same problem as inskips had - the .shtml file is running, but the include isnt being included and still has the raw <!-- #include virtual="inc/bottomnav.html" --> when you look at the source.

Is there a certain way you have to make .htaccess files? I opened a blank page in notepad, copied SteveandJoannas hta file saved, then uploaded the file and renamed it to .htaccess once it was there. Is this the proper way to do it?

Would really appreciate any help - webpage at www.katanphotography.plus.com/index.shtml

thanks,

Kat
Community Veteran
Posts: 14,469
Registered: 30-07-2007

Easy SSI

May not be the problem but try 2 things:

1) remove the space between <!-- and #include (<!--#include ......). All the examples and tutorials I have read on SSI show the command without a space so it may be significant. Any whitespace after that is fine I think.
2) Try including a .txt file rather than an html file as the previous poster was doing.
N/A

thats it!

Yes! thank you - it was the spaces. all working great now.
N/A

Damn - still not quite there

Hello again,

Thought I had it sussed - now my problem is that my actual index page works:
www.katanphotography.plus.com/index.shtml

but my domain name is www.katanphotography.co.uk. when typing in this, a big error page comes up thats not reading the SSI code OR the CSS text page - nothings working.

anyone know why this is? and how I can fix it? I want www.katanphotography.co.uk to appear in the bar, and for all my future pages to appear like www.katanphotography.co.uk/portrait.shtml etc....
Community Veteran
Posts: 14,469
Registered: 30-07-2007

Easy SSI

Above problem raised in a new thread here if you think you have a solution.
N/A

Easy SSI

Hi steveandjoanna

Your post was spot on and I am now able use SSI for pages in my web, however it does not seem to work for external content i.e. <!-- #include virtual="http://www.rentcalendar.com/en/10257" -->
I get the the error [an error occurred while processing this directive]

any ideas ?
Thanks