By default, Dreamweaver creates
links to other pages in your site using document-relative paths.
To use site root–relative path instead, you must first define a
local folder in Dreamweaver by choosing a
local root folder to serve as the equivalent of the document root
on a server. Dreamweaver uses this folder
to determine the site root–relative paths to files.
-
Select Site > Manage Sites.
- In the Manage Sites dialog box, double-click your site
in the list.
- In the Site Definition dialog box, click the Advanced
tab, if the Advanced settings aren’t showing.
The Advanced tab of the Site Definition dialog box displays
the Local Info category options.
- Set the relative path of new links by selecting the Document
or Site Root option.
Changing this setting will not convert the path of existing
links after you click OK. The setting applies only to new links
you create with Dreamweaver.
Note: Content
linked with a site root–relative path does not appear when you preview
documents in a local browser unless you specify a testing server,
or select the Preview Using Temporary File option in Edit >
Preferences > Preview In Browser. This is because browsers
don’t recognize site roots—servers do. A quick way to preview content
linked with site root–relative paths is to put the file on a remote
server, then select File > Preview In Browser.
- For site root–relative paths, enter your website URL
in the HTTP Address box.
Dreamweaver uses this address to
make sure root-relative links work on the remote server, which may
have a different site root. For example, if you are linking to an
image file located in the C:\Sales\images\ folder on your hard disk
(where Sales is your local root folder), and the URL of your completed
site is http://www.mysite.com/SalesApp/ (where SalesApp is your
remote root folder), then entering the URL in the HTTP Address box
will ensure that the path to the linked file on the remote server
is /SalesApp/images/.
Note: In previous releases, Dreamweaver failed
to append the correct remote root folder, which caused pages to
fail at runtime.
- Click OK.
The new path setting applies only to the current site.