URLs and Paths
Article ID: KB101480
Some Definitions
No doubt you've heard the phrase "URL" before. URL stands for "Uniform
Resource Locator." It is basically the address of a web site. A typical URL will
look like this:
http://www.pixelmill.com/support/html.aspx
The "http://" shows what kind of protocol is being used to transfer
the files. There are different ways that you can transfer files on the internet
- telnet, usenet, ftp, etc. "HTTP" is what is used for web pages.
An analogy
If you wanted to specify how to get to your office, you could give someone
directions if they were driving, or directions if they were taking the bus - two
different "protocols." You could write out your directions like this:
driving://cowell.1947galileo/ste101
bus://Q-line.1947galileo/ste101
The "www.pixelmill.com" is the domain name and is the address of your
site. Domain names are unique - you can't have two different sites with the
domain name "www.pixelmill.com."
The "/support/html.aspx" is the path name and shows where the file is
inside the www.pixelmill.com site.
Absolute vs. Relative Paths
An absolute path is the entire address of a web page or file and
usually looks like this, with the entire domain name and path name:
http://www.pixelmill.com/support/html_tags7.aspx
If you are on one web site and are creating a link (we'll talk more about how
later) to a different web site, you would use an absolute path to refer to their
web site. For example, a link on PixelMill to Microsoft would use an absolute
path to Microsoft's web site:
http://www.microsoft.com
If you are on your own web site and are creating a link to another place on
your page, you can drop the "http://www.yourdomain.com" and simply put a forward
slash in its place. This is another example of an absolute path to your own web
site.
For example, if we are creating a link on PixelMill, these two addresses mean
the same thing:
- http://www.pixelmilll.com/support/html_tags7.aspx
- /support/html_tags7.asp
In general, if you are on your own web site, "/" can be used to replace the
domain name.
A relative path depends on what page you're on and what you're trying
to reference. Here are some basic rules:
- A relative path for something in the same directory
doesn't have any slashes or any path information, but is just the name. For
example, if "html_tags6.aspx" is the same folder as "html_tags7.aspx," then a
relative path from html_tags7.aspx to html_tags6.aspx would look like:
html_tags6.aspx
- A relative path for something in a subdirectory shows the name of
the subdirectory, a forward slash, and then the file name. For example:
examples/lists.html
- A relative path for something in an outside directory uses "../"
for each directory level up. For example, if we are in http://www.pixelmill.com/support/examples/lists.html
and want to refer to something in the "support" folder, you could put:
../support/html_tags7.aspx
You can get nice and complicated with folders and subfolders. For example,
let's say you are at http://www.pixelmill.com/support/examples/lists.html. A
link to http://www.pixelmill.com/members/newsletter.aspx could look like:
../../members/newsletter.aspx
This tells you to go out two subfolders (so that you are in the main
www.pixelmill.com folder), then go into the members subfolder, then go to
the newsletter.aspx page.
An analogy...
Instead of telling someone: "The printer is on planet Earth, in the North
American continent, in the United States of America, in the state of California,
in the city of Sacramento, at 10 J Street, Room 3," you could just say, "Down
the hall, to the left, in Room 3." A relative path allows you to reference a
location from your current location, instead of having to use the entire
absolute path. Of course, sometimes it may be easier to use the absolute path!
Links and Images
In the next two articles you'll be learning about images and links. When
referencing images and inserting links, you'll need to be comfortable with path
names.
Was this helpful?
Please rate this article:
Email address: (not required)
(Please provide your email address if you would like PixelMill support to follow-up with you about your comment. You're email address is NOT REQUIRED to submit a comment.)
Comments: (How can we improve this article?)
Clicking "Submit" will not clear this page.
link to this page:
http://www.pixelmill.com/support/al1065/kb101480.htm
permalink to this article:
http://www.pixelmill.com/support/kb101480.htm
Back to top