Questions tagged [server-side-includes]

Server Side Includes (SSI) is a simple interpreted server-side scripting language used almost exclusively for the Web.

The most frequent use of SSI is to include the contents of one or more files into a web page on a web server. For example, a web page containing a daily quotation could include the quotation by placing the following code into the file of the web page:

<!--#include virtual="../quote.txt" -->

With one change of the quote.txt file, all pages including the file will display the latest daily quotation. The inclusion is not limited to files, and may also be the text output from a program, or the value of a system variable such as the current time.

Server Side Includes are useful for including a common piece of code throughout a site, such as a page header, a page footer and a navigation menu. Conditional navigation menus can be conditionally included using control directives.

In order for a web server to recognize an SSI-enabled HTML file and therefore carry out these instructions, either the filename should end with a special extension, by default .shtml, .stm, .shtm, or, if the server is configured to allow this, set the execution bit of the file.

As a simple programming language, SSI supports only one type: text. Its control flow is rather simple, choice is supported, but loops are not natively supported and can only be done by recursion using include or using HTTP redirect. The simple design of the language makes it easier to learn and use than most server-side scripting languages, while complicated server-side processing is often done with one of the more feature-rich programming languages. SSI is Turing complete.

Apache, nginx, lighttpd and IIS are the four major web servers that support this language.

SSI has a simple syntax: <!--#directive parameter=value parameter=value --> Directives are placed in HTML comments so that if SSI is not enabled, users will not see the SSI directives on the page, unless they look at its source. Note that the syntax does not allow spaces between the leading "<" and the directive.

236 questions
0
votes
2 answers

What can you do with server-side includes & htaccess

this issue just did not make sense to me, perhaps someone smart can help? why is it that many hosts do not allow you to set htaccess or server-side includes? specifically alot of the free hosting plans do not allow this, what are some situations…
Frank Ly
  • 631
  • 2
  • 5
  • 17
0
votes
3 answers

Is there a way of including HTML pages without needing any javascript or server-side code, only HTML

Is there a way of including HTML pages without needing any javascript or server-side code, only HTML. Basically I can't be sure if the server supports server side includes. I don't want to use javascript and I don't want to use any PHP or other…
Ankur
  • 50,282
  • 110
  • 242
  • 312
-1
votes
2 answers

server side include apache enable

I am trying to enable SSI to use it in my site. The first thing that i am want to do is just enable it and do an echo to verified if it work at all. I have apache2, in the root directory there is SSI folder and inside that folder i made a .htaccess…
lolo
  • 17,392
  • 9
  • 25
  • 49
-1
votes
1 answer

SSI (Server Side includes) don't working on IIS 10 (Windows 11)

IIS configured with Server Side includes Additionally processing SSI adding to config IIS handler mapping configured. SSI file present and I can see it in browser. But SSI still don't working. And I see in browser
...
-1
votes
1 answer

Calling CakePHP v3 Controller Function From Custom External PHP File

I have app using cakephp version 3. How to call a function from a custom php file. Assume I have a custom php file test.php. And I want to call cakephp function from controller file UrlController.php. The…
Drunken M
  • 2,013
  • 2
  • 11
  • 18
-1
votes
4 answers

connecting to another db from one server

Ok so I have a client that is trying to move half his site to another server...in this i still need to pull data from both databases. SO i have the new site and i need to do a mysql db query on the old site so i can include the old nav....but when i…
Matt Elhotiby
  • 43,028
  • 85
  • 218
  • 321
-1
votes
1 answer

Change color/ background of current active page in navigation bar

I'm designing my mobile website and using big tabs for navigation links, how can I show which page the user is currently on e.g the link background is red for example, without manually changing the css on each link per separate page. My page uses a…
Jonathan Lockley
  • 1,320
  • 5
  • 18
  • 28
-1
votes
3 answers

HTML Include file

I am using an include file by doing: I changed the include file, and the changes are not picked up. I'm guessing that they will be with a server restart; is it possible to have the changes picked up…
bmw0128
  • 13,470
  • 24
  • 68
  • 116
-2
votes
2 answers

Parse single file for SSI

I want to parse a single file (named footer.html) for SSI from my httpd.conf file. How and where do I do this? In the default directory I have options + IncludesNoExec, XBitHack on etc. Everythign works, just need to get it to work for this…
Alex
  • 8,353
  • 9
  • 45
  • 56
1 2 3
15
16