Server side includes

Discussion in 'HTML' started by Paul F. Johnson, Sep 5, 2003.

  1. Hi,

    I'm having to hardwire a server side include into a webpage (bad form I
    know, but I have a good reason).

    #include virtual="..." isn't working, all I get is "an error processing
    this directive" on the webpage.

    Is it possible to hardwire a SSI file into another html file and if so,
    how is it done?

    TTFN

    Paul
     
    Paul F. Johnson, Sep 5, 2003
    #1
    1. Advertisements

  2. Paul F. Johnson

    SteW Guest

    A bit more info would work wonders ;-) - especially the webserver type,
    actual <!--#include--> and location of the include file line.

    I am assuming apache server.

    SSI would appear to be set up otherwise it wouldn't be processing the
    directive and producing an error.

    Are you using myfile.ssi or myfile.inc etc? If so, try myfile.html or
    any other extension configured to give a text/html mime type.

    Is the include file in the same directory or in the root directory of
    the domain? If not, move it and set url to "/myfile.html" or
    "myfile.html" as required.

    Take a look at tutorials/ssi in the apache docs.

    Ste W
     
    SteW, Sep 5, 2003
    #2
    1. Advertisements

  3. Paul F. Johnson

    Bob Smith Guest

    What the *hck* is SSI?

     
    Bob Smith, Sep 5, 2003
    #3
  4. Bob Smith pounced upon this pigeonhole and pronounced:
    Please see the subject line of your post.
     
    Beauregard T. Shagnasty, Sep 5, 2003
    #4
  5. Hi,

    By the process of poking various fingers onto keys SteW generated this:
    For the real pages via a working route

    http://www.smmp.salford.ac.uk/departments/imc/

    For the broken tld way

    http://www.imc.salford.ac.uk
    Yup - 1.37 (ish)
    myfile.shtml - I have the xbithack set.

    TTFN

    Paul
     
    Paul F. Johnson, Sep 5, 2003
    #5
  6. Paul F. Johnson

    Isofarro Guest

    Isofarro, Sep 5, 2003
    #6
  7. Paul F. Johnson

    SteW Guest

    A server can be set up to parse via .shtml or by x bit or both. You are
    using belt and braces so we can't be certain that it has been set up for
    both, nor can we tell whether .shtml made the server parse the file or
    whether xbit did it.

    Using the xbithack allows any file with x set to be parsed by the server
    IIRC. If xbithack is working you don't need .shtml etxension in either
    the master file or the include file - both can be .html.

    Therefore it could be that .shtml has not been set as a recognized
    extension. So try renaming to myfile.html and altering <!--#include
    accordingly.

    I am assuming you are using a relative path to the include file, not an
    absolute one (not allowed).

    Ste W
     
    SteW, Sep 5, 2003
    #7
  8. Paul F. Johnson

    SteW Guest

    Your main file is index.html so xbithack _is_ causing parsing.
    index.shtml gave a 404 so an unrecognized extension is looking more
    likely still (but not proven). btw include files don't need x bit set
    unless they include further ssi statements.

    Would still be useful to see your #include statement (directory names,
    filenames etc changed if you want but otherwise identical), can't tell
    from view source as the page has already been parsed.

    Ste W
     
    SteW, Sep 5, 2003
    #8
  9. Paul F. Johnson

    Art Sackett Guest

    Bad form? Nah.
    Can you get at the error logs? If so, the answer to your question is
    there.

    The fact that you're getting an error message indicates that the
    document is being parsed. So, the only puzzle is the reason Apache
    cannot include the resource -- is it a text file, a script/program, or
    what?
    I'm failing to parse "hardwire a SSI file into another html file".
    What's that mean, in terms simple enough for a clod like me?
     
    Art Sackett, Sep 7, 2003
    #9
  10. Ok I just got done Jumping through all the hoops to get SSI to work on
    our site. not sure where the file is that you are trying to pull is
    located but I know that if I had a .html file in a Subfolder and my
    Header(SSI File) was in the Root I had to type ../ssi file. the ../
    tells it to go up one folder to look the ssi File. also you might have
    to change your html files to .shtml.

    Brian
     
    superdairyboy, Sep 11, 2003
    #10
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.