Haradzieniec
Haradzieniec

Reputation: 9340

html correct link path to another directory within <a href> tag

Supppose you are here http://domain.com/category/month/123. What's the correct way to put a link to http://domain.com/category on that page? Is <a href="/../category">...</a> a proper way to do that? It works, but I'm not sure if this is correct and the best way.

Thank you.

Upvotes: 1

Views: 2881

Answers (4)

Dan Lister
Dan Lister

Reputation: 2583

You could use an absolute path as follows:

<a href="/category/">link</a>

Upvotes: 0

jacksparrow007
jacksparrow007

Reputation: 1328

<a href="../../category">Link</a>

Upvotes: 0

Quentin
Quentin

Reputation: 943124

One of:

  • ../
  • /category
  • //domain.com/category
  • http://domain.com/category

You shouldn't use /../category as the logic for that is "Start at the top, then go up a level, wait there is no level … ignore that bit then, then go to category".

Upvotes: 2

Arcadien
Arcadien

Reputation: 2278

you can use "/category", the domain will be added automatically.

Upvotes: 1

Related Questions