Forum Moderators: open

Message Too Old, No Replies

What's the best way to link within a site?

/index.html or ../../../index.html

         

Bradley

5:30 am on Jun 16, 2003 (gmt 0)

10+ Year Member




Efficiency in source code and proper html has always been a focus of mine. We are redesigning our site, and I want to make sure we use the best and most proper linking method within our site. For example purposes, lets say we have the following drill down category of: /country/state/city/zip

1. If we are on the zip category page, what is the best way to link back to the state category page? Should we use a href="../../index.html" or should we use a href="/country/state/index.html" ?

2. In linking back to the homepage, should we use a href="/index.html" on all pages, or should we use a href="http:www.website.com" which would also link the visitor to the site's homepage?

3. In the above examples, if a site links one way, but then changes linking styles, would this have any positive/negative effect with regards to rankings in the major search engines?

jdMorgan

5:44 am on Jun 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Bradley,

1 & 2: I use <a href="/"> for the home page, and "../" for the index page of subdirs above the one I'm in. But I never include "index.html" in the path - I let the server resolve that to index.hrml, index.shtml, index.php, or whatever that directory happens to use as its index page. This also avoids having a long URL in search engine listings, or having to tell someone on the phone, "Sure, take a look at www.example.com/index.html," when you could just as well say, "Sure, take a look at www.example.com." Using that apporach, "../../" is likely to be shorter than even the "index"-less drill-down path.

3: No. Search engines, like browsers, will resolve the full URL before use.

Jim

g1smd

1:46 am on Jun 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I always use the absolute path like /from/top/some/folder/somepage.html both for pages, and for images, as using relative URLs can get messy if the site is redesigned and pages are subsequently moved around. By using the full names it is far easier to spot potential typos.