Forum Moderators: open

Message Too Old, No Replies

Linking to a new folder

What's the best way to link?

         

Bobby

7:49 am on Aug 4, 2004 (gmt 0)

10+ Year Member



I know this has been discussed before but I'd like to get some more thoughts about it.

I want to link to a sub folder, let's call it "sub".

Which way is the best to link?

a.) /sub
b.) /sub/
c.) /sub/index.htm
d.) http://www.mydomain/sub
e.) http://www.mydomain/sub/
f.) http://www.mydomain/sub/index.htm

Does it really make any difference at all?

Patrick Taylor

9:22 am on Aug 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Depending on whether you prefer absolute or relative links, I would use a) or d). I wouldn't ever include the index filename in a link.

As a matter of fact I've noticed that where I've used a filename in a link - eg myfile.htm - Sim Spider connects it to the domain without the slash, so I've tended to do links to a file as /myfile.htm. I'm not sure if this matters.

Bobby

11:31 am on Aug 4, 2004 (gmt 0)

10+ Year Member



Actually I prefer relative links because it makes things easier while editing locally. I was wondering if it makes a difference but I doubt it.

I don't quite follow your last part, what do you mean by

Sim Spider connects it to the domain without the slash
?

The slash (/) would tell the spider that there is a folder following the slash wouldn't it? If you have a link in the same folder then you couldn't have the slash could you?

Patrick Taylor

12:00 pm on Aug 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't know it it counts for anything, because Sim Spider isn't the crawler, but what I mean is that if I have a page - say filename.htm in the root folder - and I link to it just with filename.htm, the URL in Sim Spider has the file actually connected to the domain, with no slash, which obviously isn't a correct URL. But if I do my links with a slash in front then the Sim Spider URL is correct.

I've looked at some of the top SEO sites and some do actually link this way - with the slash in front of the filename.

jetboy_70

1:09 pm on Aug 4, 2004 (gmt 0)

10+ Year Member



Directory requests should have a trailing slash, although servers will redirect requests without them transparently. For Apache:

[httpd.apache.org ]

So for minimal server load (as above), the ability to change your page extension (maybe to .php or .aspx) without rewriting links, and the ability to move you site to another domain without rewriting links, option b.) is the best.

buckworks

1:53 pm on Aug 4, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



for minimal server load

I agree that b.) /sub/ is the best choice. During times of heavy traffic, the difference in the server load between having or not having those slashes can become a needless bottleneck. Even if you're a fanatic about writing lean code, that trailing slash is one character that it's better to keep.

g1smd

6:12 pm on Aug 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I often use e for linking to site sections, but b is also fine.

You don't need to specify the filename of a file if it is the default page that is to be served, and it also allows you to change technology (say, from index.html to index.php instead) without having to alter any internal or incoming external links.

A trailing / on the end of folder names gives both the browser and server one less step to do, and is also recommended.

chrisnrae

6:47 pm on Aug 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use e when linking to subfolders. I also use absolute linking - there was a thread a while back on why absolute links may be the way to go - not from a ranking standpoint, but from a good site structure standpoint. It was pointed out that viewing the google cache could have issues with relative links, as well as if someone saves your page to their machine for later viewing, the links wouldn't work correctly and several more reasons. I don't believe it affects anything ranking wise either way, so I go absolute for a variety of other reasons.

funkytastic

7:53 pm on Aug 19, 2004 (gmt 0)

10+ Year Member



jetboy_70 is right about linking with a trailing slash.
an added reason is that when Google follows a link to /myfolder , it will have to follow a HTTP 301 Redirect to /myfolder/ to get to the content. While Google seems to follow these redirects correctly, it can cause problems for google's link tracking. Also, some other search engines don't always follow redirects.

kaled

8:16 pm on Aug 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



All my internal links use .../dir/index.html
I ask that all backlinks use .../dir

That seems a reasonable compromise to me. Once someone enters a site, navigation is as efficient as possible, but backlinks are (or should be) as future-proof as possible.

Kaled.

buckworks

9:13 pm on Aug 19, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Why not ask external links to use the trailing slash? As several posts in this thread have mentioned, it saves a bit of work for your server, which is never a bad thing.

Also, if you use .../dir/ for your internal links, that's what will show up in the address bar, improving the chance of getting the URL formed the way you'd prefer when someone links to you "from the wild".

I can't prove this, but I'm firmly convinced that being as consistent as possible in how your links are formed, both internal and inbound, is A Good Thing.

g1smd

10:22 pm on Aug 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Including the index.html filename generally is a bad idea. If you change your site to use php or asp in the future, then you'll have to re-do all your links at that time. Specify the URL to folder level only.

If you just had links to www.domain.com/ and www.domain.com/folder/ you need change nothing when your technology changes.

jamesa

10:33 pm on Aug 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would not use file names (it shortens the URL and is easier to explain over the phone), but I would use the trailing slash as well the leading slash. Leave the domain out IMO. Adding a BASE tag [google.com] would take care of some of the relative linking issues mentioned.

g1smd

10:46 pm on Aug 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can use base but be aware that it is already deprecated in HTML 4.
This means that it should still work now, but may not be included in later versions.

shanbr

5:11 am on Aug 20, 2004 (gmt 0)

10+ Year Member



Ok, (hope this wasn't answered already)..

So does it make a difference if it "is" in another folder but I take out the /?

Let's say I take this:

[mysite.com...]

and keep the same amount of folders but make the url:

[mysite.com...]

Will that help with google any?

g1smd

7:17 pm on Aug 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Google doesn't so much look at the folder-structure of the site as really it is more interested in the click-structure. Look at your navigation menu and count how many clicks away from the index page any other page is located. That is what is really important. For me, my folder structure usualy matches the click structure, but for many sites that does not happen.

wanna_learn

10:15 am on Aug 21, 2004 (gmt 0)

10+ Year Member



Dont forget to read this
[webmasterworld.com...] :-)

Direct from horses mouth!