Site root-relative paths Site root-relative paths provide the path from the site’s root folder to a document. You may want to use these types of paths if you are working on a large website that uses several servers, or one server that hosts several different sites. However, if you are not familiar with this type of path, you may want to stick to document-relative paths.
A site root-relative path begins with a leading forward slash, which stands for the site root folder. For example, /support/tips.html is a site root-relative path to a file (tips.html) in the support subfolder of the site’s root folder.
A site root-relative path often provides the best way to specify links in a website in which you need to frequently move HTML files from one folder to another. When you move a document that contains root-relative links, you don’t need to change the links; for example, if your HTML files use root-relative links for dependent files (such as images), then if you move an HTML file, its dependent-file links are still valid. However, when you move or rename the documents linked to with root-relative links, you do need to update those links, even if the documents’ paths relative to each other haven’t changed.
For example, if you move a folder, all root-relative links to files within that folder must be updated. (If you move or rename files using the Site panel, updates all relevant links automatically.)
To use site root-relative paths, first define a local folder in by choosing a local root folder to serve as the equivalent of the document root on a server (see Setting up a site).
uses this folder to determine the site root-relative paths to files.
Note: Root-relative links are interpreted by servers, not by browsers, so if you open a local page that uses root-relative links in your browser (without using Preview in Browser from within ), the links don’t work. When you use the Preview in Browser command to preview a document that uses root-relative links, temporarily converts those links (in the previewed file only) to use document-relative paths. However, you can preview only one page that uses root-relative links at a time—if you follow a link from the previewed page, the next page’s root-relative links are not converted, and the browser can’t follow such links. Previewing pages in framesets that use root-relative links results in similar problems.
To preview a set of pages that use root-relative links, do one of the following:
Put the files on a remote server and view them from there.
(Windows only) Choose Edit > Preferences, select Preview in Browser from
the category list on the left, and then select Preview Using Local Server.
Note: To use this option, you must be running a web server on your local computer.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100