...

View Full Version : Seemingly simple problem with HTML hyperlinks



JohnnyMar
05-21-2008, 09:17 PM
I am trying to place an assortment of links on a site, however, the links I am placing are comming out like this:

http://www.evaluation.com/mmarsha/www.evaluation.com/sound/audiosample.mp3

the bolded portion of the link would be an example of one of the sites I'm placing the hyperlink on. the italicised portion is what I actually want the link to go to, but it adds the bolded portion when it opens in the browser. Heres an example of the code im using:

<ahref="www.evaluation.com/sound/Audiosample.mp3">Audiosample - Example 1</a>

Can anyone see any defect in that piece of code? or is this symptomatic of another part of the code I have to troubleshoot?

brazenskies
05-21-2008, 09:29 PM
<a href="http://www.evaluation.com/sound/Audiosample.mp3">Audiosample - Example 1</a>

If you dont add the "http://" it will treat 'www....' as the name of a directory in your root

jcdevelopment
05-21-2008, 09:31 PM
not sure if you are in the same site, but try this



<a href="/sound/Audiosample.mp3">Audiosample - Example 1</a>



or if that site is external to urs try this



<a href="http://www.evaluation.com/sound/Audiosample.mp3">Audiosample - Example 1</a>



see if that helps

VIPStephan
05-21-2008, 10:08 PM
Also watch out for a base element in your document header. It sets the base URL to use for links so it will make all your relative URLs (dir/file.ext) absolute (http://example.com/dir/file.ext) unless you specify an absolute URL manually.

JohnnyMar
05-21-2008, 10:44 PM
Wow, every possible angle covered, my gratitude could never be expressed in words!

JohnnyMar
05-21-2008, 11:08 PM
and for those who are keeping score, it was contestant number 3, Kudos for being to figure out what was wrong with my page without even seeing the code that was screwing things up!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum