473,474 Members | 1,649 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

[Q] SSIs for Navigation Bars & Subdirectories

Goal:
Have a (nearly) equivalent website on a local machine (running MacOSX)
to what exists on the web host
Problem:
I have a file call navigation_bar.txt which is included (via SSI-
#include virtual=) in every web page. References in navigation_bar.txt
that work on the web host, like

<a href="/subdir/index.shtml">

do not work on the machine when the page is hosted from a user account.
On the webhost, the DocumentRoot points to the directory that the root
index.shtml file is in. On the local machine, the DocumentRoot points to
the default location (/Library/Webserver/Documents) and the files for
the website are in ~/Sites/RootDir.

I believe the source of my problem on the local machine is that
DocumentRoot would need to point to /Users/username/Sites/RootDir

But, then I think about all of the various shareware website projects
which probably cannot assume anything about where DocumentRoot points
and still likely do something similar with navigation bars. So, I wonder
how they solved the problem. I went hunting around for such a project,
but nothing popped up right away.
Any comments?

Note: I have found one possible solution, which is to define a
VirtualHost and then have DocumentRoot point to where I would need it to
point, but I would like to develop the site in such a way that it is not
dependent upon where DocumentRoot points, like so many web applications
which are capable of sitting entirely within a subdirectory of
DocumentRoot.
(hopefully this was clear...if it was not, I can certainly answer any
clarification questions.)

thank you.
Jul 24 '05 #1
7 1568
Tim
On Wed, 06 Apr 2005 04:51:42 GMT,
eg******@verizon.net (Eric) posted:
I have a file call navigation_bar.txt which is included (via SSI-
#include virtual=) in every web page. References in navigation_bar.txt
that work on the web host, like

<a href="/subdir/index.shtml">

do not work on the machine when the page is hosted from a user account.
On the webhost, the DocumentRoot points to the directory that the root
index.shtml file is in. On the local machine, the DocumentRoot points to
the default location (/Library/Webserver/Documents) and the files for
the website are in ~/Sites/RootDir.

I believe the source of my problem on the local machine is that
DocumentRoot would need to point to /Users/username/Sites/RootDir


See if you can use relative addresses for the includes. It *may* be one
simple solution to that problem.

Otherwise, I'd implement the local copy in an identical fashion to the
remote one.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please delete some files yourself.
Jul 24 '05 #2
Tim <ti*@mail.localhost.invalid> wrote:
On Wed, 06 Apr 2005 04:51:42 GMT,
eg******@verizon.net (Eric) posted:
I have a file call navigation_bar.txt which is included (via SSI-
#include virtual=) in every web page. References in navigation_bar.txt
that work on the web host, like

<a href="/subdir/index.shtml">

do not work on the machine when the page is hosted from a user account.
On the webhost, the DocumentRoot points to the directory that the root
index.shtml file is in. On the local machine, the DocumentRoot points to
the default location (/Library/Webserver/Documents) and the files for
the website are in ~/Sites/RootDir.

I believe the source of my problem on the local machine is that
DocumentRoot would need to point to /Users/username/Sites/RootDir

First, I suppose I should have stated the goal as being:

Have a (nearly) equivalent website on a local machine to what exists on
the web host and not be dependent upon DocumentRoot.
See if you can use relative addresses for the includes. It *may* be one
simple solution to that problem.
Since navigation.txt in SSI included in every page, this would only work
for pages sitting at DocumentRoot, not for for pages sitting in a
subdirectory of DocumentRoot.
Otherwise, I'd implement the local copy in an identical fashion to the
remote one.


So, what you are saying is that other web projects do one of the
following:

Assume they either:

(1) start at DocumentRoot

(2) start in a subdirectory of DocumentRoot

(3) require the person installing to specify where they are
in relation to DocumentRoot through the use of SSI user variables

Jul 24 '05 #3
Eric wrote:
Goal:
Have a (nearly) equivalent website on a local machine (running MacOSX)
to what exists on the web host
What is different?
Problem:
I have a file call navigation_bar.txt which is included (via SSI-
#include virtual=) in every web page. References in navigation_bar.txt
that work on the web host, like
<a href="/subdir/index.shtml">
do not work on the machine when the page is hosted from a user account.
Are SSIs enabled on the local account?
On the webhost, the DocumentRoot points to the directory that the root
index.shtml file is in. On the local machine, the DocumentRoot points to
the default location (/Library/Webserver/Documents) and the files for
the website are in ~/Sites/RootDir.

The include file path is relative to DocumentRoot. If the files are in
a different place, of course it does not work. Put the .shtml files in the
DocumentRoot of the local machine.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 24 '05 #4
In article <Vc********************@giganews.com>,
Jim Moe <jm***************@sohnen-moe.com> wrote:
Eric wrote:
Goal:
Have a (nearly) equivalent website on a local machine (running MacOSX)
to what exists on the web host


I have a heavily SSI dependent site mirrored on my MacOSX machine with
no problem, but I did have enable SSI's by editing the config file
("/etc/httpd/httpd.conf") on the local server (i.e. my machine). Check
the Apache manual or Google to see what you have to change.

Denny Straussfogel
Jul 24 '05 #5
Jim Moe <jm***************@sohnen-moe.com> wrote:
On the webhost, the DocumentRoot points to the directory that the root
index.shtml file is in. On the local machine, the DocumentRoot points to
the default location (/Library/Webserver/Documents) and the files for
the website are in ~/Sites/RootDir.

The include file path is relative to DocumentRoot. If the files are in
a different place, of course it does not work. Put the .shtml files in the
DocumentRoot of the local machine.


I would like to develop a portable site - one that is not dependent upon
where it located relative to DocumentRoot.

So, I am attempting to decern how other web projects have solved this
problem.

I believe they must assume the project either:

(1) starts at DocumentRoot

(2) starts in a subdirectory of DocumentRoot

(3) requires the person installing to specify where they are
in relation to DocumentRoot through the use of SSI user variables

(4) uses server wide variables like PATH_INFO, etc. to accomplish
the same thing as #3.

Comments?


Jul 24 '05 #6
Eric wrote:
So, I am attempting to decern how other web projects have solved this
problem.

I believe they must assume the project either:
(1) starts at DocumentRoot
(2) starts in a subdirectory of DocumentRoot

The Apache httpd docs <http://httpd.apache.org/docs/howto/ssi.html>
indicate 1 and 2 are how it's done.
--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 24 '05 #7
Tim
eg******@verizon.net (Eric) posted:
First, I suppose I should have stated the goal as being:

Have a (nearly) equivalent website on a local machine to what exists on
the web host and not be dependent upon DocumentRoot.
Tim wrote:
See if you can use relative addresses for the includes. It *may* be one
simple solution to that problem. Since navigation.txt in SSI included in every page, this would only work
for pages sitting at DocumentRoot, not for for pages sitting in a
subdirectory of DocumentRoot.


Rather depends on what you're inserting where. e.g. My own server inserts
navigation menus for each sub-section, they're all in their own directory,
and they use the local nav file for the insert.
Otherwise, I'd implement the local copy in an identical fashion to the
remote one.


(Since you can control the local server as much as you're able to, and
that's probably more than your able to modify the remote one.)

How you do this depends on what you're replicating.

In my case, I make website for other people with their own domain names. I
make a virtual host on my machine for each one, and they all run
independently as if they have their own server (they each have their own
document root). I use absolute addresses within them all.

If these sites were all subdirectories off one domain, then I'd do the same
thing with my local server (mirror it). I might do this as a virtual host
in itself, that way my web server can be more than just a mirror for the
one site.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please delete some files yourself.
Jul 24 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: hedrew3 | last post by:
I created a form with a subform using the Access 2000 Forms Wizard. Both the form and the subform have their individual standard navigation bars with the minimum buttons (First, Prev, etc). My...
1
by: ralfie7 | last post by:
Is it possible to create a pure CSS (no JS) horizontal drop-down navigation menu using only css AND use includes for that navigation item? Most of the examples I see do not put their navigation in an...
5
RMWChaos
by: RMWChaos | last post by:
Apparently, I can't do anything the easy way, which seems to lead me here so very, very often. Here is what I am trying to do this time: 1. Autogenerate two navigation bars, "navLeft" and...
2
tharden3
by: tharden3 | last post by:
I have a question for you guys, I'm designing a website. Before I go any further, I'd like to get my navigation bars on the left side up and running. The site is themed to a bumblebee 'black and...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.