Setting a document’s base URL

If a document contains relative hyperlinks, Web browsers by default interpret those links as being relative to the location of the document in the site’s folder hierarchy. For example, if the document located at http://www.namo.com/products/index.html contains a link to an image file using the relative path “images/example.gif”, then browsers will expand the URL to the image file as http://www.namo.com/products/images/example.gif, since they will take “images” to be a subfolder of the folder containing the document, which is “products”.

You can change the way browsers interpret relative links in a document by specifying a base URL for the document. If you specify a base URL, browsers will ignore the location of the document in the site structure and instead interpret relative links in relation to the specified URL. Following the example given above, if the base URL of the index.html document is set to “http://www.namo.com/”, then browsers will expand the relative link “images/example.gif” to http://www.namo.com/images/example.gif.

When specifying a base URL, you must provide a full Internet URL, such as “http://www.example.com/”, “http://www.example.com/photos/”, or “http://www.example.com/photos/index.html”. Partial URLs, such as “/photos”, wil be ignored by browsers. Some browsers let you omit the leading “http://” from a base URL, but other browsers do not, so it’s a good idea to always include it. If the URL includes a folder path after the site name (but no file name), make sure to include a final slash at the end.Borders & Background.lick Borders & Background

To set a document’s base URL
  1. On the Document menu, go to Property, click Document, and then click the General tab.
  2. In the Base URL box, type the desired base URL.
Related topics

About hyperlinks

Setting a document’s base URL