In HTML within the HREF attribute of the anchor tag a web page can be referenced in many ways. This is very important in web site creation because search engine robots and spiders heavily depend on this link method. If this is not in the proper way then spiders may get confused and will create crawling problems.
Mainly there are two types of linking structure
1. Absolute Links
This is the most common way to link a document. An absolute link includes the protocol used, domain name, directory name and file name. An example of absolute link is
href="http://www.zonora.com/freecell/download.htm"
Absolute linking is the best way to refer a document because it contains all information about the document and it is not reference to any other object so a browser or search engine robot can directly fetch the resource without any problems.
But the main disadvantage with absolute linking is that it will increase the page size. This will become more crucial if you have so many links in the page. Even though pages will become bulky, this method is suggested by major search engines including Google because this is the perfect method for search engine spiders. If you don't have too may links then you can go for this linking structure.
2. Relative Links
In this method the new page is referenced from the current document with the assumption that server or robot knows the current documents location.
For example to link to another document in the same directory
href="features.htm"
Here we are just giving the file name because all other things are same for the current document and the new document including protocol, domain name and directory.
To link to a file in the parent directory
href="./products.htm"
To link to a file in two directories above
href="././file.htm"
To link to a file in a subfolder
href="subfolder/downloads.htm"
Main advantage with relative link is it reduces the page size. This is very useful if you have many links in the page. But there are many disadvantages too with relative linking. Relative link may confuse search engine spiders and create crawling problems. So always it is better to use absolute linking whenever possible. But some HTML editors like FrontPage always use relative linking.
3. Root Links
This is another way to link documents and this is a mixture of absolute link and relative link. In this method we take root of the web as the reference point and avoid using protocol and domain name.
An example of Root Linking
href="/products/file1.htm"
This method is also good for search engines but not perfect link absolute links so many webmasters don't use it.
So it is always better to use absolute links whenever possible. In normal circumstances all these three ways will works perfectly. But problems may start in the long run especially if you have too many redirected pages or 404 or other http errors.
11 Eylül 2007 Salı
Relative and Absolute Links
Gönderen
ike
zaman:
15:16
Etiketler: search engine
Kaydol:
Kayıt Yorumları (Atom)


Hiç yorum yok:
Yorum Gönder