Topic: a href="/"??? Pages that link to <a href="https://ozoneasylum.com/backlink?for=9669" title="Pages that link to Topic: a href=&amp;quot;/&amp;quot;???" rel="nofollow" >Topic: a href=&quot;/&quot;???\

 
Author Thread
Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

IP logged posted posted 08-01-2003 02:04 Edit Quote

Hi, guys. How are you today?
It has been pretty misty here since yesterday.
I cannot wash my clothes. It is not good.
Well, can I ask you something pretty difficult to understand???

Actually what does this mean???

code:
<a href="/">xxxx</a>



Why this code works without telling file name?

And how about this one?

code:
<a href="tom /">xxx</a>



What is the difference between href="tom.htm" and href="tom /"?

Please help!

Hiroki Kozai

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

IP logged posted posted 08-01-2003 02:19 Edit Quote

Hiroki: Well it all relates to the kind of links we can have:

folder/file.htm

../folder/file.htm

../../folder/file.htm

These are all relative to where the current file is stored.

I have found when you start to do a lot of includes (see War Mage's templates tutorial at the GN) it is very handy to make the links and image paths relative to the root. So your might have:

/folder/file.htm

Now if I wanted to link back to my home page I could use this:

/index.php

but as it will default to the index file (and if it doesn't you can make it) then I much prefer to get rid of the file name so it becomes:

/

as you can't have an empty set of A tags.

I have no idea what:

tom /

is all about but (unless someone knows of a good reason for it) I'd avoid it as it looks like it could cause problems.

Hope that helps

___________________
Emps

FAQs: Emperor

Wes
Paranoid (IV) Mad Scientist

From: Inside THE BOX
Insane since: May 2000

IP logged posted posted 08-01-2003 02:25 Edit Quote
quote:
but as it will default to the index file (and if it doesn't you can make it) then I much prefer to get rid of the file name so it becomes:

/


For some reason -- can't explain why -- I've always been strangely wary of just linking to "/". It's probably an irrational ... uh ... "wariness," but I always avoided it.

I mean, linking to just "/" makes sense, but I guess I was afraid some browser might go stupid seeing just a slash. I assume no one has ever had any problems with it?

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

IP logged posted posted 08-01-2003 02:32 Edit Quote

Nope, browsers handle it fine. Linking to "/" is the best way to link to the front/entrance page of your site, in my opinion.

Hiroki, if you meant "tom/" (without the space), that will link to the directory named "tom" within the current directory. So, if the page /foo/bar/baz.html links to "tom/", then the link will lead to /foo/bar/tom/. Note that linking to just "tom" would also work, but including the trailing slash clarifies exactly what you're linking to.

Emps, you said "you can't have an empty set of A tags"; what did you mean by this? If you meant that you can't link to "" (as in, <a href=""> ), you're incorrect - linking to "" is equivalent to linking to the current page. (This is convenient when you want to link to an anchor on the current page, with href="#anchor", or send paramaters to the current page with href="?foo=bar".)

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

IP logged posted posted 08-01-2003 02:45 Edit Quote

Slime: Good points

___________________
Emps

FAQs: Emperor

Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

IP logged posted posted 08-01-2003 04:50 Edit Quote

Hi, guys. How are you?
Great to hear from you, guys.
Many many thanks for your replies.
Could I ask a bit more?

Emp:

quote:
Now if I wanted to link back to my home page I could use this:

/index.php

but as it will default to the index file (and if it doesn't you can make it) then I much prefer to get rid of the file name so it becomes:

/



Actually I am cunfused where those index file has to be.
For example, There are two htm files. One is home.htm, which is my index page. And another called tom.htm. Do you stay in the same folder when I use those just slash thing?

And I have been wondering what is the difference between
/image/hiroki.jpg and image/hiroki.jpg

In my example, hiroki.jpg is inside of folder image, isn't it?
What does slash in front of the first example do???

Hmm...Please help.

Hiroki Kozai

[This message has been edited by Hiroki (edited 08-01-2003).]

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

IP logged posted posted 08-01-2003 05:02 Edit Quote

Consider an HTML page at http://www.slimeland.com/content/articles/ . The HTML page has two hyperlinks:

<a href="/image/hiroki.jpg">link 1</a>

<a href="image/hiroki.jpg">link 2</a>

link 1 links to http://www.slimeland.com/image/hiroki.jpg .
link 2 links to http://www.slimeland.com/content/articles/image/hiroki.jpg .

The difference is that the link with a leading slash means "start at the root of this website," but the one without a trailing slash means "start at the folder that i'm already in."

Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

IP logged posted posted 08-01-2003 05:26 Edit Quote

Hi, Slime.
Many many thanks for making good example.
Very kind of you.
Just wonder if those two example links are other way around???
Slash takes to root folder, doesn't it?

Hiroki Kozai

Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

IP logged posted posted 08-01-2003 05:39 Edit Quote

Hi, guys. And this one please?

code:
http://www.hiroki.org/home/



I found this kind of address when I surf.
But feel very strange. Why can I see the html life without seeing something like

code:
http://www.hiroki.org/home/hiroki.htm



Hmm....confused.
I alwasy make sub folder in the root folder like folders called htm, css, image, js and so on. Then always my path looks like <a href="../htm/hiroki.htm">
I think this *consistent* way is pretty good. I don't see the point to locate one folder into another.......



Hiroki Kozai

silence
Maniac (V) Inmate

From: soon to be "the land down under"
Insane since: Jan 2001

IP logged posted posted 08-01-2003 10:31 Edit Quote


It has to do with the way a web server is set up. There are certain file names that are set as default so that the server knows which page to serve up.

For example, when going to a link such as http://www.google.com, you're actually going to http://www.google.com/index.html, or whatever page they set as their default.

On most web servers, index.htm, index.html are set as the default index pages.

As a more concrete example, if you go to www.blueskynet.as/alo you'll see that you're really looking at www.blueskynet.as/alo/index.html becuase I have an index.html file in that directory.

But if you go to www.blueskynet.as/alo/ozone, you'll notice that you get a listing of the files in that directory since there's no index.html file in there and the web server doesn't have a default page to present.

Note that you can use any file as your default, it doesn't have to be index.html

Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

IP logged posted posted 08-02-2003 05:14 Edit Quote

Hi, Silence:

quote:
But if you go to www.blueskynet.as/alo/ozone, you'll notice that you get a listing of the files in that directory since there's no index.html file in there and the web server doesn't have a default page to present.



Yes, I understand that.
So let myself clear.

If my folder including index.htm or index.html, I don't have to say something like:

hiroki/index.htm

I can just say

hiroki/


Is that right??? If so, thanks very much.


Hiroki Kozai

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

IP logged posted posted 08-02-2003 05:35 Edit Quote

That's right.

It does, however, depend on the server you're using. A server can be set to use any file name like that, not just "index.html". (Some servers, for instance, may also look for "main.html", but not all servers.)

However, 99% of the time, index.html will work.

By the way; you said that you usually put all of your HTML files in an "htm" directory. Personally, I would suggest organizing slightly differently - rather than putting all your HTML files in one directory, try using multiple directories (however many are necessary) to categorize your web site into logical groups.

For instance, on my site, I have an "images" directory. It has an index.html inside it, so I can give people the link http://www.slimeland.com/images/ , and it brings them to my images page. The advantage of this is that they know where they're going *before* they click on the link, just by looking at the URL. Obviously, a link that ends in "images" will have some sort of picture gallery.

That's just one example. It doesn't really matter until you have a full web site with different types of content, but when you do, it's nice to have clean, simple, descriptive URLs like that. It can also help if your web site starts getting large, because the organization will keep things from getting out of hand. (Files will be easy to find.)

ozphactor
Maniac (V) Inmate

From: California
Insane since: Jul 2003

IP logged posted posted 08-02-2003 05:38 Edit Quote

Yup, that's right.

Another advantage of doing it this way is in case you ever decide to switch over to a PHP-based site or some other server-side scripting, you won't have to change the extension.

That is if "index.htm" suddenly became "index.php" or "index.asp", you don't have to do any find and replace, because the server will search for any page named "index".

Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

IP logged posted posted 08-04-2003 02:14 Edit Quote

Hi, guys. Many thanks for your explanations.
Well, sounds good, isn't it?
I'd love to make it easy for users.
From point of view, user can easy to understand where they are going to.
Many thanks a lot.
Have a happy Monday.
Cya.

Hiroki Kozai

Bmud
Bipolar (III) Inmate

From: Raleigh, NC
Insane since: Mar 2001

IP logged posted posted 08-22-2003 19:41 Edit Quote
quote:
<a href="/image/hiroki.jpg">link 1</a>

<a href="image/hiroki.jpg">link 2</a>

link 1 links to http://www.slimeland.com/image/hiroki.jpg .
link 2 links to http://www.slimeland.com/content/articles/image/hiroki.jpg .



Amazing!

Shine and shine. :: [Cell=992] :: [See my team's 30 second animation]



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu