.:: Best Way Of Hyperlinking? ::.

Status
Not open for further replies.

tuXian

In the zone
Soppose I have a domain abc.com

Whats the best way of hyperlinking from within the site?I mean linking between the various site pages.

Code:
[url="filename.htm"]xyz[/url]

OR

Code:
[url="*www.abc.com/filename.htm"]xyz[/url]

What are the pros and cons of linking in both the ways?

Do they invite or prevent problems/errors?

Which one is more optomized for Search Engines?

Will the page load time differ in both the cases? if yes then why?

Any other thing?

Plz post in ur comments
 

theraven

Technomancer
no difference boss
the first option is simply there to prevent retyping of the entire URL afaik !
so no worries ;)
 

sreevirus

Certified Nutz
theraven said:
no difference boss
the first option is simply there to prevent retyping of the entire URL afaik !
so no worries
well raven, u might be wrong here...
i made a simple html file with the following codes and tested it on firefox and IE..
Code:
[url="*www.google.com/"]google[/url] 
[url="*google.com/"]google[/url]
[url="www.google.com"]google[/url]
[url="google.com"]google[/url]
[url="google"]google[/url] 

[url="*www.google.co.in/intl/en/about.html"]about google[/url]
[url="google.co.in/intl/en/about.html"]about google[/url]

while the first, second and fifth codes gave normal results and directed me to the respective sites, the others directed me to these links:
Code:
file:///F:/My%20Files/www.google.com
file:///F:/My%20Files/google.com
file:///F:/My%20Files/google

file:///F:/My%20Files/google.co.in/intl/en/about.html

well, i thot it might be just coz the file is on my hard disk....so i then tried the codes on an old news page in disco82 phpnuke site..again, while the first, second and fifth links directed me to the original sites, the others directed me to these:
Code:
*disco82.ecwhost.com/phpnuke/www.google.com
*disco82.ecwhost.com/phpnuke/google.com
*disco82.ecwhost.com/phpnuke/google

*disco82.ecwhost.com/phpnuke/google.co.in/intl/en/about.html
:roll:

the catch: from my tests, the best way of hyperlinking is to add * before the site...

well, just for a confirmation, some1 pls try similar codes on some site and reply :)
 

theraven

Technomancer
?
im not quite sure thats what he was askin

if you're in a site ...
say *www.abc.com/index.html
and u wanna link to *www.abc.com/about.html
then instead of giving
About ON the index.html page ...
i can give About as long as the directory is the same
if the about page is in a directory /about
then i can give the following code

About

he was talkin abt the code given on a website

if u wish to test this create 2 html files
in one give the complete address of the second file ... as well as only filename.html and try
they both will work !

his question was whether theres a difference between the 2 links as per search results etc
and theres no diff AFAIK !!!

infact by cutting down the number of characters u type in the in the html file ur also saving space !!
;)
 

icecoolz

Cyborg Agent
If the links are relative to the domain then there is no need to give the whole link. Just the page is enough. If not then the whole link needs to be given.
 

ramprasad

In the zone
Hi
My opinion is that using relative links is the best method. If u use absolute url then u might not be able to use the same page for more than one website.....

Regards,
Ramprasad
 

enoonmai

Cyborg Agent
What are the pros and cons of linking in both the ways?

theraven is right. Always use relative addressing. "Hard coding" the URLs in a website is considered poor site design, and makes it impossible to reuse your code if you switch domains. Do not hard-code your URLs unless its absolutely necessary or you're linking to a third party site that you know for sure wont change or if its not within your control.


Do they invite or prevent problems/errors?

Each has its own share or pros and cons. Relative addressing makes it easy to migrate your site and prevents mistakes, broken links and typing out code all over again and doing a "Find and replace" Use hard-coded URLs only if you're linking to third party sites separate from your domain.

Which one is more optomized for Search Engines?

The search engine doesn't care one way or the other. All the spiders do is follow links, and if you use the hard-coded URL they take that, else they just parse the relative address and understand that its in the same site and leech it anyway. Like I said, spider-bots just dont care.

Will the page load time differ in both the cases? if yes
then why?

I am yet to see a difference in page load times because of hard-coding or relative addressing. So at this point, it doesn't make a difference either way.

Any other thing?

YES! I repeat, always use relative addressing, it will save you a lot of trouble fixing broken links later. Remember this rule - hard code URLs if and only if you're linking to a third party site.
 
Status
Not open for further replies.
Top Bottom