-1

From parsing several websites, it seems that with a "/" in the beginning of the link, it points to a different location than without. For example, URL = "http://www.google.com/a/b/c/index.html" <a href = "/location1.html"> will link to "http://www.google.com/location1.html", essentially (domain+link). And <a href = "location2.html"> will link to "http://www.google.com/a/b/c/location2.html".

Is my understanding correct?

Yang
  • 6,682
  • 20
  • 64
  • 96

1 Answers1

0

Those are relative paths:

if your domain name was http://google.com

Then you could do:

/location1.html

or

/location2.html

and that would point to: http://google.com/location1.html

but since you probably don't own that domain in order to link to google.com you need to include an absolute path:

http://www.google.com/a/b/c/location1.html
Joe L.
  • 4,433
  • 1
  • 19
  • 14
  • I took google.com for example. I own the domain. You can try this example in your own browser. href1 href2 – Yang Dec 08 '14 at 18:06
  • 1
    Oh ok. So basically you can do /location1.html and it will point to http://yourdomain/location1.html . Hope that helps. – Joe L. Dec 08 '14 at 18:07