deadlock Message Board
[ July Full List | Reply ]

Re: HREF
From Ann on 6 July '00
replying to HREF posted by Liliane

>Can anyone please clarify the following :
>When linking pages together within the same web site where all files
>are located in the same directory is it necessary and/or better to
>use the full URL address i.e.
><A HREF="http://www.myweb.com/links.html"> or is it enough to state
>just the file name as <A HREF="links.html"> ?
>
>What are the pros and cons if any.
>Many thanks in advance.

I prefer the "relative" approach - just the file name. This works if, as you say, everything is in one directory. With this approach, you don't have to recode if you move your site. If you have directories above or below the path of the particular page in which the reference appears, you can still use relative references in the form "./mysubdir/links.html" to refer to a subdirectory called "mysubdir" in the same directory as the page or "../mysubdir/links.html" where the "../" part of the path is the "parent" directory - in this case you would back up two levels, then look for "mysubdir".




Reply to this message

Required Details
Your name:
Subject:

Optional Details
Home page title:
Home page URL:
Email:
(if you'd like to receive automatic replies by email)

Your Message