473,686 Members | 2,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

links to current directory in html


about href links to other html pages in current directory:

w3c seems to recommond using ./pagename
and just pagename works too.

Is there any actual difference in these two?
I think no in Windows, but less sure about Unix.

what about links back to main page?

Is ./ any better than ./index.html ?

I assume all are much better than http://www.domainname.com
to avoid DNS lookup.

Apr 24 '06 #1
4 6664
Wayne wrote:
about href links to other html pages in current directory:

w3c seems to recommond using ./pagename
and just pagename works too.
Where exactly did you find such a recommendation?
Is there any actual difference in these two?
I think no in Windows, but less sure about Unix.
The OS is irrelevant, it would be defined by the relevant RFC for URIs.
what about links back to main page?

Is ./ any better than ./index.html ?
Assuming the page is being served from a web server (not just read from
the local file system) then "./" is better if you want to link to the
index of the current directory and, similarly, just "/" when you want to
link to the root directory. From the local file system, you don't have
much choice about including index.html because it typically won't work
without it.

That's because "index.html " is unnecessary and because if you change
server or implementation details e.g. switch to IIS which typically uses
default.htm or switch to a server side technology like PHP (index.php),
then it's easier to avoid changing URIs and setting up redirects.
I assume all are much better than http://www.domainname.com
to avoid DNS lookup.


DNS lookup is irrelvant, the URI you use in the markup makes no
difference. If the page is served from that the domain, then (in the
absense of a <base> element or xml:base attribute that says otherwise)
any relative URIs will resolve to that domain anyway and the browser
will retrive it in exactly the same way. It's just unnecessary to
include the domain in links to the same server.

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox
Apr 24 '06 #2
Dan

Wayne wrote:
Is ./ any better than ./index.html ?


I discuss this issue in my Web Tips site:
http://webtips.dan.info/subdir.html

--
Dan

Apr 24 '06 #3
In article <11************ *********@t31g2 000cwb.googlegr oups.com>,
da*@tobias.name says...
I discuss this issue in my Web Tips site:
http://webtips.dan.info/subdir.html

Thanks Dan. I had not considered if the browser might consider it a
different file name or not.

Lachlan, that "recommendation " was just my own judgement, but I
reference the example at
http://www.w3.org/TR/REC-html40/struct/links.html
almost halfway down the page, where it says:
'Thus, a link defined in the file "two.html" in the same directory as
"one.html" would refer to the anchor as follows:'

Apr 24 '06 #4
Wayne wrote:
about href links to other html pages in current directory:

w3c seems to recommond using ./pagename
and just pagename works too.
Is there any actual difference in these two?
None. With no leading path "./" is implied.
what about links back to main page?
What about them?
I assume all are much better than http://www.domainname.com
to avoid DNS lookup.

Not really. Only the first instance requires a lookup. After that the
result is cached.
Not using a "http://example.com/" offers a maintenance advantage. Having
a local site that reflects the public site's structure is a lot easier to
maintain. The same code works at both sites.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Apr 24 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
10554
by: Chris | last post by:
I'm using eight links listed horizontally as a menu on my site. I'm using font-variant:small-caps and they are padded so that they mimic buttons. My gripe is with the way IE handles the focus rectangle on these links. It insists on drawing this crazy shape that traces the text, which with small caps looks rather assinine. Firefox handles the same task very gracefully (yeah Gecko!) and I would like to force IE to do the same. The site...
9
2724
by: Alex Bell | last post by:
Please review http://www.members.iinet.net.au/~abell1/test/TempMain.html and http://www.members.iinet.net.au/~abell1/test/TempActy.html They both use city.css in the same directory, and are both templates. Both have menus on the left, and both show the hover effect by reversing the colour and background colour and the border colours. I have been able to show that the home page link is the current page in TempMain.html by greying out...
7
4723
by: Jonas Smithson | last post by:
Hello all, I have an absolute positioned parent div, and nested inside it is an absolute positioned child div -- I mean the div *code* is nested inside, but the child is physically positioned so that it's completely outside the parent div (to the left of its parent, in a left-side margin area). The child div contains hyperlinks. Explorer 6 (on Windows) has no problem with this. However, in Netscape 6, the links are unclickable. I...
6
5390
by: Shaun Heveron | last post by:
Hi, I'm working on a portable ANSI C++ application designed to compile and execute under Windows and LINUX/UNIX. Is there a portable way of obtaining the current working directory? Sorry, if I'm being stupid... Thanks,
5
3323
by: Sally B. | last post by:
Hello, I searched, but couldn't find answers--probably because I'm not sure what this is called... Anyway, I have about 50 web pages and I want to have some JavaScript that will read in a list of keywords, scan the web page and create links on any of those keywords... Is there any way to do this sort of thing? Thanks!
1
1531
by: John Seeliger | last post by:
I am pretty new to VB, so please forgive the simplistic question. This is using VB .NET Standard 2003. My form has three objects on it: a TextBox named URL, a Button named Extract and a WebBrowser named AxWebBrowser1. The goal is to have the user enter a URL in the TextBox and then hit the Extract button and then to get the links from the web page they entered. So far I have:
6
7544
by: titan.nyquist | last post by:
The WebBrowser control won't load a css file written in the same directory as the program. If I put an absolute path to it, it will load it. Thus, the current directory of the WebBrowser control isn't the current directory of the program. What is the current directory? I don't want to use an absolute path, since its contents are saved to disk, and that should always load the css file no matter where it and the css file exists. Titan
7
5221
by: David Stone | last post by:
Run into something recently that has left me a little puzzled. According to the examples in section 13.6.1 of html 4.01... <http://www.w3.org/TR/html401/struct/objects.html#h-13.6.1.1> I should be able to use <aelements with a specified shape and coords within a <mapso that I can use the links with an actual image and, at the same time, have the links appear as text. Something like the map associated with
2
3134
iam_clint
by: iam_clint | last post by:
/*###############################*/ /* Link fade script by iam_clint, bytes.com */ /* www.bytes.com, If you use this script on your site */ /* Please keep this comment at the top of the javascript */ /*###############################*/ window.onload=function() { setupLinks(); } var red=0; /*base 16*/ var green=15; /*15 because I want the faded in color to be super green*/
0
8584
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8932
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8768
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6440
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5796
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2945
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2205
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1934
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.