homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

Duplicate references to domain in address bar

 5:10 am on Oct 23, 2012 (gmt 0)

Perhaps someone can point me in the right direction to solve this problem.

Existing HTML code:
<a href="../utility/page.html">name</a>

Produces this in the address bar:

Whereas, this HTML code:
<a href="www.example.com/utility/page.html">name</a>

Produces a 404 error and this in the address bar:

Note the double reference to www.example.com. There is no canonical or base reference in the <head>.

I await being embarrassed... :(



 6:32 am on Oct 23, 2012 (gmt 0)

Use the Live HTTP Headers extension for Firefox to examine the browser and server headers.

You'll see that's what you requested, rather than the server delivering some wierd redirect.

Add http:// to the link and you'll fix it.


 8:13 am on Oct 23, 2012 (gmt 0)

Thanks g1. You were correct. It seems I missed placing http:// in the links on a number of web pages and this inconsistency threw me into a state of confusion.

Thanks again for your help. I appreciate your quick response.


 8:41 am on Oct 23, 2012 (gmt 0)

There is no canonical or base reference in the <head>.

Doesn't need to be. It's implicit in HTML's handling of links.

Anyway, both forms are ... uhm ... not ideal :) http:// for your own site is overkill, and ../ is risky.


 7:42 pm on Oct 23, 2012 (gmt 0)

<a href="../utility/page.html">name</a> - dangerous form, do not use.

<a href="http://www.example.com/utility/page.html">name</a> - over-specified, but no problem.

<a href="/utility/page.html">name</a> - ideal format.

 9:36 pm on Oct 23, 2012 (gmt 0)

When I started my site some 14 years ago, I used MS Frontpage for authoring, and your option number 1 was the program's default method for referencing internal links.

I have abandoned FP and have been cleaning up the code for some time. I will try your method number three and test.

Thanks for the explanation of preferred practice.


 9:41 pm on Oct 23, 2012 (gmt 0)

Yes. Yet another thing we can blame Frontpage for.

It was done that way so you could easily preview pages without installing Apache or similar. It was a backward step.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved