href = ?

R

RobM

Frogleg said:
Is there a rationale for preferring

href="http://www.domain.com/index.com" over

href="index.com"

for a site where just a few pages are kept in a single directory?

Hi Frogleg...

My 2c... I prefer the latter for portability:

The code can run anywhere on any server, in any subdirectory (or web
application), doesnt have to be changed if one server uses SSL (https), can
run under a different port without being changed (e.g. testing at home using
localhost:8081/index.com).. I'm sure there's more (easy on the browser?) but
portability for me.

Cheers
RobM
 
S

SpaceGirl

Frogleg said:
Is there a rationale for preferring

href="http://www.domain.com/index.com" over

href="index.com"

for a site where just a few pages are kept in a single directory?


er... that makes no sense.

..com files are executables
..exe files are too :)

http://something.com/ (or some other extension) = a web site.

http://www.domain.com/index.com would be a REALLY bad name for a page.

http://www.domain.com/index.htm would be a lot better :)

Anyway, your question doesn't make sense... you ask which is the best
way, when both are completely and utterly wrong...



--


x theSpaceGirl (miranda)

# lead designer @ http://www.dhnewmedia.com #
# remove NO SPAM to email, or use form on website #
 
R

RobM

er... that makes no sense.

.com files are executables
.exe files are too :)

http://something.com/ (or some other extension) = a web site.

http://www.domain.com/index.com would be a REALLY bad name for a page.

http://www.domain.com/index.htm would be a lot better :)

Anyway, your question doesn't make sense... you ask which is the best
way, when both are completely and utterly wrong...

x theSpaceGirl (miranda)
Hi - quick question (I ignored the OP's use of .com thinking spelling
mustake) - just out of interest, what do you see utterly wrong with
href="index.htm" ? Or do you mean it should be href="/index.htm" ?

Thanks
RobM
 
S

SpaceGirl

RobM said:
Hi - quick question (I ignored the OP's use of .com thinking spelling
mustake) - just out of interest, what do you see utterly wrong with
href="index.htm" ? Or do you mean it should be href="/index.htm" ?

Thanks
RobM

Nothing at all. I was just picking up the OPs' mistake :) There's no
problem with absolute or relative paths... they both have their uses.

--


x theSpaceGirl (miranda)

# lead designer @ http://www.dhnewmedia.com #
# remove NO SPAM to email, or use form on website #
 
R

RobM

Anyway, your question doesn't make sense... you ask which is the best
Nothing at all. I was just picking up the OPs' mistake :) There's no
problem with absolute or relative paths... they both have their uses.
x theSpaceGirl (miranda)

Gotcha. Thanks. (Well spotted... perhaps OP had a problem because really was
using .com!).
 
J

Jeffrey Silverman

Is there a rationale for preferring

href="http://www.domain.com/index.com" over

href="index.com"

for a site where just a few pages are kept in a single directory?

Some useful and relevant information (links to information, that is):

<http://archive.ncsa.uiuc.edu/General/Internet/WWW/HTMLPrimerP2.html#RL>
<http://www.google.com/search?q=rela...illa-search&start=0&start=0&ie=utf-8&oe=utf-8>
<http://www.google.com/search?hl=en&lr=&ie=UTF-8&safe=off&q=relative+vs+absolute+URLs+&btnG=Search>

later...
 
D

Daniel R. Tobias

SpaceGirl said:
.com files are executables
.exe files are too :)

http://something.com/ (or some other extension) = a web site.

http://www.domain.com/index.com would be a REALLY bad name for a page.

http://www.domain.com/index.htm would be a lot better :)

http://www.domain.com/index.html would be even better as far as I'm
concerned, since ".html" is the proper abbreviation of HTML (the "L"
is part of the name of the format). ".htm" is a bastard Microsoftism.

However, if index.htm[l] is the default index of the directory (as it
usually is), it would be even better to reference it as
http://www.domain.com/, or, if using a relative reference, as "./" (a
dot followed by a slash), thus creating a reference to the directory
index without the filename hardcoded, as I discuss here:
http://webtips.dan.info/subdir.html

On the other hand, file extensions have no official meaning in Web
standards, so you can theoretically serve an HTML document from a URL
containing a ".com" file extension, and it will be standards-compliant
if sent with the proper MIME type. However, certain inferior (but
popular) browsers violate the standards and second-guess MIME types
based on things including the file extension, and hence might mess up
if you do things like that.
 
N

Neal

.com files are executables

Actually, you can map any .whatever to any file type on the server. You
can name all your pages with .cat or .dog if you want. In a HTTP context,
it's not a filename extension in the typical OS sense. It's a world of its
own.
 
S

SpaceGirl

Neal said:
Actually, you can map any .whatever to any file type on the server. You
can name all your pages with .cat or .dog if you want. In a HTTP
context, it's not a filename extension in the typical OS sense. It's a
world of its own.

yes of course mr pedantic pants - but it could be confusing for the poor
end user, and if the web server is badly setup or does something weird
with MIME? It's probably just not a good idea, even if it can be done, duh.

--


x theSpaceGirl (miranda)

# lead designer @ http://www.dhnewmedia.com #
# remove NO SPAM to email, or use form on website #
 
S

SpaceGirl

Toby said:
SpaceGirl wrote:




Not in this part of the world they're not.

Another world, I'd suggest. Planet Linux. Population, 7 people and daddy
Linus Torvil. A blessed world where everyone is always right, and
nothing else matters. Yes? :)

--


x theSpaceGirl (miranda)

# lead designer @ http://www.dhnewmedia.com #
# remove NO SPAM to email, or use form on website #
 
S

Sam Hughes

(e-mail address removed) (Daniel R. Tobias) wrote in
http://www.domain.com/index.html would be even better as far as I'm
concerned, since ".html" is the proper abbreviation of HTML (the "L"
is part of the name of the format). ".htm" is a bastard Microsoftism.

Pish posh. "HTML" is the abbreviation of "HyperText Markup Language."
When talking about a document, however, it should be called a "HyperText
Markup Document," because including "Language" would just be redundant
and silly. Thus, HTM is the cooler acronym, and therefore, the cooler
file extension.

Of course, only the insecure want to be cool, so let's do the opposite of
that: the rest of us can bask en mass in our individualistic usage of the
bloated ".html" file extension.
However, if index.htm[l] is the default index of the directory (as it
usually is), it would be even better to reference it as
http://www.domain.com/, or, if using a relative reference, as "./" (a
dot followed by a slash), thus creating a reference to the directory
index without the filename hardcoded, as I discuss here:
http://webtips.dan.info/subdir.html

On the other hand, file extensions have no official meaning in Web
standards,

So let's use NO file extensions. Or use .exe for ordinary HTML documents
:) Maybe some .scr too :-O
so you can theoretically serve an HTML document from a URL
containing a ".com" file extension, and it will be standards-compliant
if sent with the proper MIME type. However, certain inferior (but
popular) browsers violate the standards and second-guess MIME types
based on things including the file extension, and hence might mess up
if you do things like that.

And so pages upon pages were _renamed_. The great beast looked on in
curiousity, as they _blinded_ the eyes of Mammon into _confusion_ and
_bewilderment_.
from The Book of Mozilla, 9:29
 
N

Neal

yes of course mr pedantic pants

I LOVE it when you call me that.
- but it could be confusing for the poor end user, and if the web server
is badly setup or does something weird with MIME? It's probably just not
a good idea, even if it can be done, duh.

Sure. But life is confusing. Big whoop.

Let's talk about my pants some more...
 
T

Toby Inkster

SpaceGirl said:
yes of course mr pedantic pants - but it could be confusing for the poor
end user

Chances that the end user will look at the URL: one in ten.

Chances that someone who looks at the URL will associate ".com" with an
MS-DOS command rather than "dot com" websites: one in ten.

Chances that someone who looks at the URL and *does* associate ".com" with
MS-DOS understands that URL "extensions" are meaningless: one in three.

So you might confuse 0.66% of users.

But if you rename the file, lots of people will get 404 errors and get
confused.
 
D

Dennis M. Marks

Frogleg said:
Oops. Sorry. Early morning typing. I meant

href="http://www.domain.com/index.htm" and
href="index.htm"

Assuming that www.domain.com is YOUR domain they are the same. The
second version would be better since you could test your site offline
by running from a single directory with all your html. Also if the
domain name changed you would not need to change all of the html.
 
F

Frogleg

Assuming that www.domain.com is YOUR domain they are the same. The
second version would be better since you could test your site offline
by running from a single directory with all your html. Also if the
domain name changed you would not need to change all of the html.

Thanks. OTOH, if I use "index.htm", I can view my site offline on my
own system with any browser.

I just wanted to know if there were any preferences for 'complete'
local hrefs, and the rationale behind such a preference. Seems like
there're more reasons to use the 'short' version, so I'll stick with
it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top