Harvard Extension School
CSCI E-12 Fundamentals of Web Site Development | Fall 2019

## Recommendation: Use Relative Links within a Site

There are advantages to using relative links to those resources within a site.

Obviously, links that are outside of the site need to be fully qualified.

A site will often have multiple versions -- you might develop the site locally, a testing site, a staging site, and a production site (sometimes not all of these will exist, but certainly more than one environment will exist for a site).

Using relative links within a site will let you move your web work from your local development site to the next level, and all the links will still point to the correct places!

Relative links will keep your site "self-contained" and easily transportable to different environments -- for example, when you move from

- `acme.localhost` to
- `dev.acme.com` to
- `test.acme.com` to
- `stage.acme.com` to
- `www.acme.com`

Copyright © David Heitmeyer