Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!



Photo
- - - - -

Is A Complete Path Same As ../../../


  • Please log in to reply
4 replies to this topic

#1 lister

lister

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 426 posts

Posted 01 April 2013 - 09:43 PM

Something I have often wondered - is it 100% the same thing to link to a file like this:

<a href = "../../../../folder/" > anchor </a>

 

-- or --

 

<a href = "http://mywebsite.com/folder/" > anchor </a>

Clearly option 2 - the full path, has little chance of becoming broken -

 

Are both the same thing in the eyes of a SE?


Edited by lister, 01 April 2013 - 09:43 PM.


#2 Michael Martinez

Michael Martinez

    HR 10

  • Active Members
  • PipPipPipPipPipPipPipPipPipPip
  • 5,293 posts
  • Location:Georgia

Posted 02 April 2013 - 12:49 AM

Your first example is usually called a "relative URL", meaning that it is resolved by your browser at the time you click on the link relative to whatever directory/folder the browser (or search engine) is currently looking at.  Relative URLs can be duplicated across many folders in a large Website but all resolve to different actual pages.  Relative URLs can be very troublesome, especially if they are encoded in multiple partial formats.

 

Your second example is usually called an "absolute URL" (although technically it's "an absolute, fully resolved URL").  Every URL has to be fully-resolved before it can be used to fetch content.  The chief difference between RELATIVE and ABSOLUTE URLs is that with relative URLs the browser (or search engine) figures out how to fully resolve the link and with absolute URLs the resolution is provided by the Web content.

 

I have recommended that people use absolute, fully resolved URLs for many, many years as there is no real "safe" way to ensure that relative URLs will always take the visitor to the correct destination.


Edited by Michael Martinez, 02 April 2013 - 12:50 AM.


#3 Alan Perkins

Alan Perkins

    Token male admin

  • Admin
  • 1,647 posts
  • Location:UK

Posted 02 April 2013 - 02:53 AM

Are both the same thing in the eyes of a SE?

 

Yes - assuming both resolve to the same URL, then both are the same thing.

 

More details: Search engines normalise all URLs before processing, and both of those URLs would normalise to the same thing

 

Far more details: read the section on "normalisation" in my article on URL Canonicalisation and Normalisation.



#4 lister

lister

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 426 posts

Posted 02 April 2013 - 09:49 AM

Thanks for all replies. I guess the a complete path is better practice with CSS and Javascript files etc? Point being that it eliminates any unnecessary broken links - 

 



#5 chrishirst

chrishirst

    A not so moderate moderator.

  • Moderator
  • 7,546 posts
  • Location:Blackpool UK

Posted 02 April 2013 - 11:43 AM

A path that does not change relative to where the current URLs is 'best'. So either an absolute path or a root relative path.

 

/dir/subdir/subdir/file.ext is root relative and means start at the root of the site ie: domain.tld/ or just /. and traverse the branches '/' downwards

 

 

file.ext or dir/file.ext means "start at the same level as the location of this file URL"

 

../file.ext means start one directory branch higher than the current level and traverse each branch '/' UPWARDS. This does take the server a few microseconds longer to locate and serve the appropriate document.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

SPAM FREE FORUM!
 
If you are just registering to spam,
don't bother. You will be wasting your
time as your spam will never see the
light of day!