Server side includes

  • Thread starter Paul F. Johnson
  • Start date
P

Paul F. Johnson

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
 
S

SteW

Paul said:
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

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
 
B

Bob Smith

What the *hck* is SSI?

SteW said:
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
 
P

Paul F. Johnson

Hi,

By the process of poking various fingers onto keys SteW generated this:
A bit more info would work wonders ;-) - especially the webserver type,
actual <!--#include--> and location of the include file line.

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
I am assuming apache server.

Yup - 1.37 (ish)
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.

myfile.shtml - I have the xbithack set.

TTFN

Paul
 
S

SteW

Paul said:
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

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
 
S

SteW

SteW said:
Therefore it could be that .shtml has not been set as a recognized
extension.

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
 
A

Art Sackett

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

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

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?
Is it possible to hardwire a SSI file into another html file and if so,
how is it done?

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?
 
S

superdairyboy

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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top