Should I use relative or absolute linking?

When moving the Intranet Connections application to a new location, links pointing to internal locations will need to be altered with the transfer. Transfer problem rise when absolute link are used for links, images, videos etc. The following article will provide information on absolute vs. relative linking, when to use absolute or relative linking, examples of each and converting an absolute link to a relative link.

Using links to propagate through an applications server is an important task for an Intranet administrator. The two options available for linking are: absolute links and relative links. An absolute link is a link made up of the entire path to a specific file.

Absolute link example --

http://www.mycompany.com/intranet/Graphics/Custom/myimage.png

Absolute links are best used for external sources that contain little potential for a modification in domain name or server folder structure. For links pointing to internal sources, relative links are the better option. Relative links do not rely on static URL addresses and remain relatively unharmed in the case of a Intranet relocation. Furthermore, relative links use symbols to represent the current location. The following examples demonstrate the abilities of relative linking:

Relative linking example(s) --

Relative Link Description
picture.png picture.png resides in the current directory
Images/picture.png picture.png exists in the Images folder (one level deeper in comparison to the current location)
../picture.png picture.png is located in one directory up from the current location
../../picture.png picture.png resides in two directories up from the current location

 

As seen with the examples, shown above, the flexibility provided by relative links allow for an easier Intranet relocation while reducing wasted administrative efforts in fixing broken link issues.

Absolute to Relative Link Conversion

In order for Absolute-to-Relative link conversion to take place, users must know the absolute link to the Intranet application. The absolute link to an Intranet root directory may vary from user to user. Regardless, when the link to the Intranet root directory has been determined, the Intranet root portion of a desired link can be stripped and replaced with "../" in order to become relative. The follow examples demonstrate converting an E-Form Builder form absolute link to a relative link.

Absolute-to-Relative conversion example(s) --

Absolute Link(s) Conversion Result
http://www.intranet.com/formbuilder/viewform.cfm?formID=13 ../formbuilder/viewform.cfm?formID=13
http://www.mycompany.com/Intranet/formbuilder/viewform.cfm?formID=13 ../formbuilder/viewform.cfm?formID=13

 

In conclusion, Intranet Connections recommends the usage of relative links when possible and provide absolute links when pointing to a external source that cannot be hosted on the local server. For further information regarding the use of relative linking with images using a Message Box widget, click here.

Have more questions? Submit a request

0 Comments

Article is closed for comments.