[BNM] Embarrassingly dumb html path question

Andy Smith bnmlist@brightonnewmedia.org
Fri Mar 14 16:15:00 2003

Andy Budd wrote:

> It's never seemed to work on any servers that i've used.
> I'm uploading a site at the moment that is being hosted on a shared
> server and all the HTML is using absolute method. Non of it works so
> I'm having to go though doing a find and replace on all the
> paths witch
> is a bit of a drag.

You may have problems if your site root is in a subdirectory rather than the root directory of the server. For example:

Your site root:           http://www.example.com/site/
Page with the link on it: http://www.example.com/site/dir1/page1.html
Page you want to link to: http://www.example.com/site/dir2/page2.html

If in page1.html you have <a href="/dir2/page2.html"> the browser will resolve this to http://www.example.com/dir2/page2.html - in this case you would want to make sure all your relative URLs of this form start with "/site/" rather than "/".

Or are you having problems with a site where the site root is the same as the server root, like http://www.example.com/ ? If so I think it must be a browser bug, although I haven't heard of any browsers with a bug like that.

andy smith  |  web developer  |  preview graphics  |  +44 (0) 1273 834434  |  www.preview.co.uk

CONFIDENTIALITY AND DISCLAIMER NOTICE: This e-mail is intended only for
the addressee named above and the contents should not be disclosed to
any other party. If you have received this e-mail in error, please
notify the sender and delete the e-mail and any attachments from your
system. Any views or opinions presented are solely those of the sender
and do not necessarily represent those of Preview Graphics Ltd. unless
otherwise specifically stated. Although this email has been scanned for
viruses, we advise you to carry out your own virus checks before opening
any attachment as we cannot accept liability for any damage sustained as
a result of any software viruses or other malicious code.