February 18, 201016 yr Hello again, I really hope someone can help me please. The link from the code below works fine online when I click the "about" link , but does not work when I try to use Dreamweaver to preview the page on the local machine (Firefox or IE). <li class="about_selected"><a href="../about/" title="About ADS" accesskey="2">About Us</a></li> I understand that this is a relative link and that using ../ move a level up. The site set-up goes something like this: about folder------¦ ¦ ¦ ¦ index.html ¦ contact folder--¦ ¦ ¦ ¦ index.html ¦ index.html I hope that makes sense. The web address is: http://www.adsgroup.com/ Danny Edited February 19, 201016 yr by Sam G added [code] tags
February 19, 201016 yr Locally, the ../ may be causing you to leave the folder your site is in. This doesn't happen on a server as it is limited to htdocs. For example, if your site is located at: /Users/YourName/Sites/MySite or, My Documents/Sites/MySite if you're viewing a page locally which is within the MySite folder (no sub-directory), the ../ actually takes you out of MySite and into Sites.
February 19, 201016 yr Author Thanks Andy, I get it now, so how does a Dreamweaver user test the links when the links are used that way?
February 19, 201016 yr There could also be a problem because you haven't stated a filename here:- <li class="about_selected"><a href="../about/" title="About ADS" accesskey="2">About Us</a></li> /about/ means a server will look for a file called index inside a folder/directory called about, but I don't think your computer or Dreamweaver will look for an index file. I should always put a filename after the folder/directory name like:- <li class="about_selected"><a href="../about/index.html" title="About ADS" accesskey="2">About Us</a></li> Edited February 19, 201016 yr by Sam G added [code] tags
February 19, 201016 yr Thanks Andy, I get it now, so how does a Dreamweaver user test the links when the links are used that way? Either use the .php extension and have a variable containing your site url (or local url), or don't use relative linking
Create an account or sign in to comment