Server side includes

G

Glen

I have a menu bar in the directory above the directory which has a shtml
file with the line <!--#include file="../menu.html" -->
I get a message saying an error occurred while processing this directive.

If I move a copy of the menu file in the same directory and change the line
to <!--#include file="menu.html" --> it works perfectally.

How can I have the on file in the top directory instead of a copy in each
directory?

Thank-you
 
?

=?iso-8859-1?Q?Kim_Andr=E9_Aker=F8?=

Glen said:
I have a menu bar in the directory above the directory which has a
shtml file with the line <!--#include file="../menu.html" -->
I get a message saying an error occurred while processing this
directive.

If I move a copy of the menu file in the same directory and change
the line to <!--#include file="menu.html" --> it works perfectally.

How can I have the on file in the top directory instead of a copy in
each directory?

You might even try using the "virtual" parameter for that include, like
this:
<!--#include virtual="../menu.html" -->

With the "virtual" parameter, the root directory ("/") references the
public_html directory (or htdocs, depending on what it's called on your
particular server).
 
T

Toby Inkster

Glen said:
How can I have the on file in the top directory instead of a copy in each
directory?

Possibly some security mechanism is stopping you from including files
from upwards in the directory tree.

Solution would be to keep the following files:

/menu.html (the real menu)
/somedir/menu.html (symbolic link to "../menu.html")
/somedir/page.html (which includes "menu.html")
/otherdir/menu.html (symbolic link to "../menu.html")
/otherdir/page.html (which includes "menu.html")
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top