Dr. Mark Humphrys

School of Computing. Dublin City University.

Online coding site: Ancient Brain

coders   JavaScript worlds

Search:

Free AI exercises


SSI

With hundreds or more pages, you will want to separate out code that is common to all pages.

SSI is one way of doing this. But far from the only way.




SSI is invisible to client




SSI at DCU




SSI Exercise

  1. Make a file.shtml in your web directory:
    cd
    cd public_html
    gedit file.shtml &
    
  2. Insert an SSI line in the file to get it to include another html file.
  3. Test it works. Look at:
    https://student.computing.dcu.ie/~username/file.shtml
    and see that it is including the other file.



Other SSI directives

There are other SSI directives.

One useful one is to echo environment variables that exist on the server.

See: SSI environment variables demo




Other ways of doing header / common code

  1. PHP
     include "header.php";  


  2. JavaScript
     <script src="header.js" ></script> 
    where header.js does:
     document.write ( bunch of HTML ); 


ancientbrain.com      w2mind.org      humphrysfamilytree.com

On the Internet since 1987.      New 250 G VPS server.

Note: Links on this site to user-generated content like Wikipedia are highlighted in red as possibly unreliable. My view is that such links are highly useful but flawed.