New in working with SSI and html developments

Discussion in 'Web Design and Development' started by Txutx, Feb 19, 2009.

  1. Txutx macrumors newbie

    Feb 19, 2009
    I have to develop a web using SSI (<!--include virtual="file").
    I am using Emacs for editing the code and firefox with a validation pluging to verify it, but I have realized it does not work.

    I have been reading other threads about modifying files, and talking about servers but I do not understand a word.

    Can anyone please explain me if it is possible, which tools do I need or which files should I modify? I have a MacBook with Tiger version. An explanation for beginners please.

    Thanks in advance,

  2. angelwatt Moderator emeritus


    Aug 16, 2005
    The web server needs SSI to be turn on and configured.
    Pages using SSI need a .shtml extension (by default anyways).

    There are threads here that talk about turning on SSI on Mac.
  3. SrWebDeveloper macrumors 68000


    Dec 7, 2007
    Alexandria, VA, USA
    On top of what angelwatt said, your syntax is wrong and the web server will not parse it properly.

    The correct syntax is:

    <!--#include virtual="relative_path_to/file.ext" -->
    Notice the # symbol, the spacing and the --> on the end.

    How to setup SSI
    Here is a great page on many of the SSI directives you can use.

    1) Enable SSI, configure .shtml as the extension to parse SSI
    2) Create example.shtml and add in SSI directives with the correct syntax and you're GTG

  4. Txutx thread starter macrumors newbie

    Feb 19, 2009
    Hello again,
    I am trying to incluye SSI on my page html. I have tried to follow the instructions of what I have read in the forum but I am not able of making it work.

    I hope anybody could help me to fix what I am doing wrong.

    I have a folder in my Desktop which is called /doc_es/ and inside it two files copyright.shtml and ssi_trial.html.

    <p> Copyright 2002 <a href="">You</a>.</p>


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

    <title> Copyright Information </title>

    <h1>Copyright information </h1>
    <!--#include virtual="/Users/macbook/Desktop/doc_es/copyright.shtml"
    I am using MAMP to have a local web server.
    I have read that before start using the SSI I have to activate them by modifying the file /etc/httdp/httdp.conf

    These are the changes I have made:

    * I have verified the following lines are uncommented:
    Load Module includes_module libexec/httpd/
    AddModule mod_include.c

    * I have changed the location folder of my files

    DocumentRoot ”/Users/macbook/Desktop/doc_es”
    <Directory />
    Options FollowSymLinks MultiViews Includes
    Exec CGI
    AllowOverride All

    <Directory “/Users/macbook/Desktop/doc_es”>
    Options Includes Indexes Follow SymLinks MultiViews
    AllowOverride All
    Order allow, deny
    Allow from all

    <IfModule mod_dir.c>
    DirectoryIndex index.shtml index.html

    * And I have uncommented :
    AddType text/html .shtml
    AddHandler server-parsed .shtml
    Then, I have saved the file with the changes in the Desktop and I have moved the modified http.conf to the /etc/httpd/ folder.
    I have restarted the server
    I have seen that the file instead of having wheel has macbook on the information (ls –l)

    -rw-r—r—1 macbook macbook

    I have used the following instruction just in case but nothing has changed.

    %nidum group.| grep ‘admin|macbook|wheel’

    I have opened the file using the firefox


    But I cannot see the part inserted by the copyright.shtml. (At mamp, the Document root is /Users/macbook/Desktop/doc_es) and I have also modified the expression of the path to the shtml file included in the ssi_trial.html file, but nothing.

    Any other idea ?
    I am very new on this, and I have no more ideas.

    Thanks in advance,

  5. angelwatt Moderator emeritus


    Aug 16, 2005
    Your .html needs to be .shtml. Whatever file uses the SSI syntax needs to be parsed ans SHTML so it'll need that extension. Your copyright file can be .html since it doesn't use any SSI syntax.
  6. Txutx thread starter macrumors newbie

    Feb 19, 2009
    Thank you very much for the indications.
    I will review all the code in order to be able to use SSI with .shtml.


Share This Page