Absolute URLs vs. relative URLs vs. protocol relative URLs

Examples

Absolute URL:
http://yoursite.com/folder/subfolder/file.html
Relative URL:
/folder/subfolder/file.html
Protocol relative URL:
//anothersite.com/anotherfolder/anothersubfolder/anotherfile.html

Tips

  • Try to avoid absolute URLs.
  • Try to use relative URLs for links inside your site.
  • Try to use protocol relative URLs for links outside your site.
Advertisements

About Dimitrios Kalemis

I am a systems engineer specializing in Microsoft products and technologies. I am also an author. Please visit my blog to see the blog posts I have written, the books I have written and the applications I have created. I definitely recommend my blog posts under the category "Management", all my books and all my applications. I believe that you will find them interesting and useful. I am in the process of writing more blog posts and books, so please visit my blog from time to time to see what I come up with next. I am also active on other sites; links to those you can find in the "About me" page of my blog.
This entry was posted in Web design. Bookmark the permalink.