Publishing Menu

Absolute URL vs Relative URL

Absolute vs relative URL structure: which one is better?

A file/page/location in HTML can be linked to either by using absolute or relative paths.

An absolute link specifies exactly the location of the file on the Internet, it is a direct link to that file. You know exactly where it is and where to look for it on the Internet. An absolute path defines a location by including the protocol, the server, the directory (if needed) and the full name of the document including its extension.

An absolute link looks like this:
<a href="http://www.example.com/index.html"></a>

http - the protocol

example.com - the server name

index.html - file name with extension

-Absolute links might be easier for search engines to follow as they resolve all relative URLs to absolute ones before following them.
-They are also safer when switching to a new CMS;
-Absolute URLs is easier when dealing with https pages.
-Absolute URLs are safer in terms of elimiating potential duplicate content issues.

With a relative path, you skip the protocol and server/domain name and go directly to the page name. It does not include the direct location of a file on the Internet. It simply holds data about the file location within the server it locates in.
A relative link looks like this:

<a href="/page.html">

A relative link makes it easy to move from one domain to another one. When your domain is moved from one domain to another you would have to change all absolute links on your website to new domain name while with relative structure you do not need to worry about that.

In terms of seo there is no real difference using an absolute or relative url, though it’s better to use Absolute URLs over Relative. If you’re not planning to change your site structure or domain. For more SEO tips, please vitis Webmaster Forum.
 


 



 
Tools
Author
 
Biodun Yusuf
Articles: 4