Forum Moderators: phranque

Message Too Old, No Replies

Problems Serving "/file.html" links

         

joeclark

4:23 am on Jan 24, 2005 (gmt 0)

10+ Year Member



I am developing a web site on a remote server that allows me to enter image source or href links as "/folder/file.html", etc. This "/" always references the root directory of the site ("DocumentRoot" in Apache terms). I'd like to be able to set up Apache to do the same, but it appears that by default it is not set up this way. I think this is probably a simple configuration option, but I'm not sure what that option is. I tried an "Alias / /var/www/html" type command, but that made the whole site inaccessible. Any other ideas? Thanks.

jdMorgan

5:21 am on Jan 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



joeclark,

Welcome to WebmasterWorld!

I'm afraid I don't really understand your question. The ability to use relative or rooted link tags in HTML documents is normal for modern browsers. It is in fact the browser that resolves these links to their canonical form, i.e. http://www.example.com/file.html using your title example.

As far as the server is concerned, all you should need is the DocumentRoot declaration in httpd.conf, barring any further complications or configuration irregularities.

Jim

joeclark

5:48 am on Jan 24, 2005 (gmt 0)

10+ Year Member



Actually, you're right. The problem is that I have some files that use *php* includes with that syntax, and I don't think php accepts that. So...yeah, after fixing the php include it works right...I guess the real question is why does the other server allow this:

<?php include("/stylesheet.inc");?>

But I don't care...it works now, so thanks for your help and making me rethink my problem. :-)