[Xitami] how to configure alias
d.butt
xitami@lists.xitami.org
Tue, 6 Nov 2001 16:54:56 -0000
Based on the info below is it possible for you to send me the paths that I
put in both alias boxes so that when I insert an image <IMG
SRC="../../../images/masthead.gif" BORDER="0" WIDTH="600" HEIGHT="100"
ALIGN="bottom" ALT="">it will work
C:\Xitami\cgi-bin\esp-pages This is the path to the folder which holds the
files
C:\images this is the path to the images folder
Dai
http://www.dezineasite.co.uk
http://www.crazybiker.f2s.com
----- Original Message -----
From: "Simon McVittie" <smcv@pseudorandom.co.uk>
To: <xitami@lists.xitami.org>
Sent: Tuesday, November 06, 2001 3:56 PM
Subject: Re: [Xitami] how to configure alias
> > I'm testing things localy on my pc not on the host server and when I go
> > insert an imasge from the image folder it goes back 3 levels as so
> > <IMG SRC="../../../images/bevel_bg.jpg" BORDER="0" WIDTH="150"
HEIGHT="40"
> > ALIGN="bottom" ALT="">
> > now al I want is to confige the alias to read any images from this
folder on
> > my c:drive
> > is this correct if not can you give the correct configuration
> > images=c:\images\ http://127.0.0.1/c:/images/.gif/.jpg./.png
>
> If you're running Xitami on your PC, that *is* the host server. Your web
> browser (Internet Explorer, Netscape, whatever) doesn't read from the disk
> itself if you're testing your site through Xitami - all it knows about
your
> site is what Xitami tells it.
>
> If you set an alias like
>
> [Alias]
> images=c:\images
>
> then, for example, going to the URL http://127.0.0.1/images/bevel_bg.jpg
> will get you the contents of the file 'c:\images\bevel_bg.jpg'. (*
footnote)
>
> In general, an alias like
>
> [Alias]
> aliased/server/path=c:\real\path\on\disk
>
> will map the URL
> http://127.0.0.1/aliased/server/path/somefolder/somefile.ext
> to the real file
> c:\real\path\on\disk\somefolder\somefile.ext
> (I hope you can see where the the components of this path come from).
>
> It sounds as though your HTML writing software is getting its relative
> paths wrong, or making big assumptions about how your real disk filesystem
> maps to the server's "virtual filesystem". If the current working
directory
> is '/cgi-bin', which it is for these scripts, your web browser *can't* go
> up 3 levels, because as far as it can see there's only one level to go up
> through (it goes up one level to '/', then can't see any further).
>
> If you have an alias like the one above you can use an image with a tag
like
>
> <img src="../images/bevel.jpg" alt="">
>
> which your web browser will expand to
> http://127.0.0.1/cgi-bin/../images/bevel.jpg
> then contract to
> http://127.0.0.1/images/bevel.jpg
> before it sends
> the request.
>
> It may be better to use an absolute path like
>
> <img src="/images/bevel.jpg" alt=""> (this one is probably better),
>
> which your web browser will expand to http://127.0.0.1/images/bevel.jpg
> before it sends the request.
>
> It's impossible to go up 3 levels because your browser doesn't know
there's
> anything above the root, so it won't send a request which goes above /;
and
> because, for security reasons, Xitami won't send files from outside the
> webpages root, unless it's been told to do so by an alias. This is to
> prevent arbitrary users doing things like sending a request for something
> like http://127.0.0.1/../../windows/system/user.dat and getting half your
> Registry.
>
>
> *: Xitami assumes your 'images' directory contains the icons which come
> with it (this isn't great design IMO, but that's how it works). If you
want
> directory listings to look right, you might need to copy the images from
> c:\xitami\webpages\images (or wherever you have Xitami installed) into the
> folder which will be accessible as http://127.0.0.1/images/ (e.g.
> c:\images).
>
>
>
>
> --
> Xitami Users Mailing List -- For Xitami support
> To unsubscribe: http://lists.xitami.org/mailman/listinfo/xitami
>