web server permissions question

Matthew Seaman m.seaman at infracaninophile.co.uk
Wed Dec 29 07:49:08 PST 2004


Jay O'Brien wrote:

> I found how to get around this problem, and it isn't permissions 
> at all. On the other web server I use, I use relative and shortened 
> addressing on links, for example /xyz which, when selected by the 
> user, would then send the user the /xyz/home.html file, in the xyz 
> subdirectory under the directory where the home page lives.

Hmmm... Actually, that's how it's supposed to work: the automatic 
addition of trailing slashes is not implied.  Remember that even though 
URLs look a bit like directory paths, they are actually very different 
beasts indeed.  As a webmaster you can, optionally, configure your site 
to be helpful by adding slashes to requests, if you want, but you should 
never rely on that behaviour.  If you're writing HTML then you should 
always take care to state the URLs correctly.

The reasons why /foo is a different URL to /foo/ are all to do with how 
aliasing works in HTTP -- ie. exactly how the URL is mapped onto the 
filesystem (or to some sort of virtual space like a Java object 
hierarchy) in order to retrieve the requested data.   It isn't always 
simple -- in fact, this is one of those occasions where you might hear 
the dread term "arbitrarily complex".

> Now, with this version, I find that I must add a trailing /, using 
> /xyz/ instead of /xyz, and with that change everything works as 
> expected. I can now access home.html files in subtending directories 
> with such shortened relative links from my LAN and from the internet. 

Take a look at this article which explains (amongst a lot of other 
interesting stuff) how to get your Apache server to do internal 
redirects for these trailing slash cases -- from the user PoV it will 
"just work":

     http://httpd.apache.org/docs-2.0/misc/rewriteguide.html

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       8 Dane Court Manor
                                                       School Rd
PGP: http://www.infracaninophile.co.uk/pgpkey         Tilmanstone
Tel: +44 1304 617253                                  Kent, CT14 0JL UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 372 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20041229/9600261c/signature.bin


More information about the freebsd-questions mailing list