In HTTP, links starting with
http:// and including a domain name (e.g.
http://example.com/foo/bar) is known as absolute paths. On a Drupal site, they should only be used for off-site links. Links not starting with
/foo/bar) is known as relative paths. Relative paths should be used for internal links on your site. When a relative path starts with a slash (
/) it is relative to the Drupal site root. When it does not, it is relative to the location where it is embedded.
By making sure all internal links are specified using relative paths, they will not have to be changed when you move your site from one server to another.
For example, to link to
/node/42, (provided you've clean URLs enabled) you can use the following markup:
<a href="/node/42">Link to node 42</a>
(For menu items, as described bellow, you should omit the initial
/, as menu items are always relative to the Drupal root.)
Eventually, I'd like to put these links in a menu I've got displayed at the top of all pages in my site.
Support for this use case is already in place in Drupal.
Navigate to: Administration » Structure » Menus and click on the link "List links" for the Main menu. Then click on Add link. In the field "Path" type in the relative path to the location (e.g. node path) in your site you want this menu item to point. Also provide meaningful "Menu link title" and "Description" strings. End by clicking Save. Now the link will appear in your main menu, which in most (including the default "Bartik") themes are displayed at the top of all pages on the site.