May
20

SSI

  No Remarks |

Today I just about finished re-designing the Strawberry Web Builder. I’ve applied the new layout to my entire site, when I realized that using SSI would be very helpful. I could use it to display my links so when I want to add or delete links I will only have to edit one page instead of 100’s and it will apply to all of them. Doing this took a lot of work and time.

I had to rename all my files with the file extension .shtml instead of .php. I then had to do a search and replace on each file to replace the links. I tried buying software to do this, but it failed me so I had to do it all manually which took several hours over a coarse of 2 days. I then asked the seller of the software for a refund because his script was defective. If you sell scripts make sure they work and give easy to follow instructions on setting them up.

So what’s SSI?

Well of coarse I will be adding a tutorial on how to use it on the Strawberry Web Builder, but to give a brief overview; SSI is also known as Server Side Includes. You can use it to display dates, times, display CGI results, and include files.

The first thing you should do is make sure all your files using SSI have a file extension of .shtml. Next make sure your server has SSI enabled by testing this code to see if it works:

<!--#echo var="DATE_LOCAL" -->

If the date showed up then you’re good to go.

To include files like a footer, sidebar or header. Name your files: footer.shtml, sidebar.shtml, and header.shtml.

Add your links and text to these files and place the following code on your page where you want the information to show up:

<!--#include virtual="/filename.shtml" -->

Replace filename with sidebar, footer, header or whatever you named your file.

If you are using SSI in a sub domain and you’re getting a error displaying this:

[an error occurred while processing this directive]

Then SSI may not be enabled for your sub domains. Email your web host to have them enable it for you. I had to update this…

With subdomains you must use the exact path for them to work so instead of using:

subdomain.yoursite.com/file.shtml

You would use:

yoursite/subdomain/file.shtml

And that’s all there is to it!

I’ll rewrite this tutorial even better when I add the SSI tutorials to my site. Hope this helps until then.

Arranged Within: Web-Design