Help - Search - Members - Calendar
Full Version: absolute address ?
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
asmith
Hi,

Is it possible to address a link from the root of site without including http://www.example.com ?

for example, I have this : http://www.example.com/img.jpg

and in an html file located at http://www.example.com/folder1/folder2/file.html

I want to put that image.
but not to include the
http://www.example.com/
and
../../img.jpg

is there some character to give me the first directory of the site ?
for example : ./img.jpg

Hope I said it clear

(the problem is I may be in lot of folders, and don't know how much I have to come back (with these ../ ../) , so I wanna start from the root. I don't wanna use the domain name, cause this address will go for a form action, and for soem reason site says, it can't post data to another sites...)
Darin McGrew
You're looking for a "root relative" URL like /img.jpg or /folder1/folder2/file.html

Please see the FAQ entry How can I avoid using the whole URL?
Christian J
Just note that such URLs will not work with offline HTML pages (since the root then means the root of the HD). A local/offline server shouldn't be a problem, though.
asmith
Thanks guys biggrin.gif

Problem solved, Thanks a lot.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.