You will probably not argue that relative URLs (Uniform Resource Locators) are very useful feature of websites, especially as for web creation process. If once some webpage had to move somewhere else (and it usually has to at least from developer’s localhost to production environment), it would be a tedious process to rewrite it, so using relative addresses is very convenient.
But there are situations when absolute URLs better fit our needs, or when they are even essential. A typical example is when you want to copy the source of some website or its part. There are relative URLs for images and included styles. Of course, you want to use it in another domain, so relative URLs are not what you want, if you don’t want to also copy all included content. Another example of usage is when you want to download that included content. Again, you need to have its absolute URL.
So the task is to convert all relative URL addresses to their absolute counterparts. But before I show you how to this, let’s discuss occurences and all possible forms of relative URLs. We will deal with HTTP(S) scheme URLs.