sh****@vt.edu wrote:
I am trying to create a code repository for myself and am having
trouble linking to files. Basically, the web server computer has
drives from several other computers nfs mounted to it -- and I want to
link to a file (just a .C file) on one of the nfs mounted drives. I'm
an html novice and have tried:
<p><a href="/home/nfs_drive_mount_point/dir/script.C">script.C</a></p>
But the link comes up as:
http://www.hostname.com/home/nfs_dri...t/dir/script.C
As it should.
>
I also tried using href="file:///..." and still had no luck.
Some browser versions limit this kind of access deliberately.
I know it must be something stupid that I'm missing, but if someone
could shine some light on it, that would be great.
The problem is that a Web server sees files differently from the way the
OS sees them, (even when they are the exact same files).
What are you using, IIS? Let's take that example:
When you install Microsoft's IIS, it creates a file structure within the
OS (some flavor of Windows) for its own purposes. By default, it creates
(i.e., it asks the OS to create) C:\Inetpub\wwwroot, with some other
subdirectories in wwwroot. Meanwhile, within the site (IIS
administration) the admin can create a structure for resources to be
served. Subfolders in the site are created in the OS with the same name
(by default, anyway; I believe they can be different).
So for
www.example.com, the server machine has some files, like
default.htm and contactus.asp, which are located on its C: drive
(remember, this is configurable) in C:\Inetpub\wwwroot. Some images for
default.htm might be in C:\Inetpub\wwwroot\images\.
The Internet visitor browses to
http://www.example.com/, and sees the
home page, possibly shown as
http://www.example.com/default.com. The
images for the page can be seen (using the browser's View Source) to
come from
http://www.example.com/images/.
The Web service (here, IIS) can be configured to map real (OS)
directories to virtual (Web) directories. How one does this depends on
the service (IIS, Apache, etc.) and version thereof. See your admin ;-)
You'll need to tell your Web server to serve these resources somehow,
and adjust your links accordingly. It may not work out as neatly as you
wish. Also, it's been a while since I've done this sort of thing, so add
salt to taste. GL.
HTH.
--
John