Brett
Brett

Reputation: 2785

html base and subdirectories

In my html I have

<head>
 <base href="http://mydomain.com/dev/">
</head>

But my links all go to mydomain.com/ (without the "dev" subfolder). Why aren't my links pointing to the subfolder?

Thanks in advance.

EDIT: my link html is:

<div id="navigation">
<ul>
  <li><a href="/index.html">Home</a></li>
  <li><a href="/realestate.html">Real Estate</a></li>
  <li><a href="/property.html">Vehicles &amp; Boats</a></li>
  <li><a href="/location.html">Auction Locations</a></li>
  <li><a href="/auctionDetails.html">How the Auction Works</a></li>
  <li><a href="/contact.html" class="activeTab">Contact</a></li>
</ul>

Again, thanks.

Upvotes: 6

Views: 2697

Answers (1)

Quentin
Quentin

Reputation: 943124

You are using root relative URIs (<a href="/foo">) instead of document relative URIs (<a href="foo">).

Resolution will start from http://example.com/dev/ but the / will cause the local part (everything after the domain/port number) to be dropped.

Do not start your links with a / character.

Upvotes: 7

Related Questions