Links - Please help?

Results 1 to 3 of 3

Thread: Links - Please help?

  1. #1
    Niall Carroll Guest

    Default Links - Please help?

    Hi,<BR>I have a website developed, there is about 150 pages. Before it goes live, do i need to change the href&#039s from /pagename.htm, to

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default Nope

    It should work fine. Just test it in the intERnet environment.

  3. #3
    Join Date
    Dec 1969

    Default RE: Links - Please help?

    The answer depends on your directory structure and on whether you have a typo in your example. Let me explain.<BR><BR>There are two types of links. Absolute and relative.<BR><BR>An example of an absolute link is &#060;a href=""&#062;. This is an absolute link because you can place it in any page in your site, no matter where that page is located, and it will always point to the same file. <BR><BR>An example of a relative link would be &#060;a href="pagename.htm"&#062;. This is relative because it points to a file within the same directory of the file containing the link. If the file containing the link is in the root directory of your site it would work the same way as the absolute linke above, and point to "". <BR><BR>The difference occurs when the file containing the link is in a subdirectory. For example, if the file is in a directory named "sub", the &#060;a href="pagename.htm"&#062; link would point to ""<BR><BR>Now the reason I mentioned a possible typo in your example was that you wrote "/pagename.htm". The difference here is the "/" in front of the file name. If you write a link as &#060;a href="/pagename.htm"&#062; the "/" is essentially the turns the link into an absolute link again. This is because the "/" means to go down to the "root" of the web site. In other words "/" is interpreted the same way as if you had typed "". <BR><BR>If all of your pages are within the root directory then it doesn&#039t really matter which method you use. But it is good practice to use relative links whenever possible. Relative links make it easy to test a site locally, move it to another server, or burn it onto a CD, without having to recode all the links.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts