Did you come here from joomlajunkie.com? This is our new home and we are in the process of moving so some links on joomlajunkie are already redirecting to here.

hide forever

Welcome to Prothemer - the new home for JoomlaJunkie.com

only the blog for now but there is much more coming soon...

Should I use a relative or absolute url?

There is nothing more annoying then moving a website to a new domain name, and finding you, or somebody else, used a ton of absolute links.

Now you have to scour code and articles to fix them, since they are pointing to the old domain. Is there a better solution? Enter, relative links.

oookay, first things first. What’s the difference?


orly?

An absolute link uses the entire domain name to point to your resource. so if you want to include a url in your website, if you used a absolute link it would look like this.

absolute link

You can see there is a full url path included. (ht tp: // www.fancywebsite.com)

Now, a relative link is when the server already knows where the file or resource is. A relative link looks like this.

relative link

In this example you can see there is no full url such as a .com

oic

Relative URLs are great if you move your site. With Joomla 1.5 you have very little changing to do in your configuration.php. You only have to change 2 values in that file and your site is moved. If you are in the habit of using absolute urls in your content, your website designs, or your images, now is the time to fully understand how cool relative links are, and how they will save you considerable amounts of time over the long haul.

Liked this post? Help spread the word by sharing it!
  • Digg
  • StumbleUpon
  • del.icio.us
  • LinkedIn
  • Facebook
  • Design Float
  • FriendFeed
  • Identi.ca
  • muti
  • Posterous
  • Sphinn
  • Tumblr
  • Twitter


  • SEF urls | More than just good looks.

    SEF urls not only look good, but they make your site harder to hack. Enabling SEF urls in your Joomla backend is a great......

  • No Responses to "Should I use a relative or absolute url?"

    Leave a Comment |  RSS feed for comments on this post. |  TrackBack URL

    Leave a Reply

    CommentLuv Enabled