Forum Moderators: open

Message Too Old, No Replies

Final word on trailing slash?

not / or not to /

         

tkroll

4:27 pm on Jul 1, 2003 (gmt 0)

10+ Year Member



I've been sorting through the archives to find the definitive answer on this:

Does Google care about the trailing / in a url? I still get different PRs with and without the slash. My site is also rather new, so maybe it just needs to even itself out.

Thanks for the patience.

daisho

4:45 am on Jul 2, 2003 (gmt 0)

10+ Year Member



If it is a directory and you leave off the slash apache will automatically send a redirect to the browser directing it to the page with a slash.

I guess PR will depend of what you decide to link to either slash or no slash.

daisho.

buckworks

5:09 am on Jul 2, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



It's good practice to get in the habit of using the trailing slash in all your links, because saving steps for the server can help keep things working smoothly if traffic becomes heavy.

However, for contexts such as print ads, many companies omit the trailing slash in the URL they ask people to type in. Making life easier for visitors would be the priority there.

marcs

5:13 am on Jul 2, 2003 (gmt 0)

10+ Year Member



If it is a directory and you leave off the slash apache will automatically send a redirect to the browser...

Depends on the Apache version/setup.

Be consistant. Try not to have incoming links to both.

daisho

6:15 am on Jul 2, 2003 (gmt 0)

10+ Year Member



/home/httpd/devel_planetcharter/cgi-bin

All recent versions and a default install though I'm sure you could turn this feature off if you wanted.

daisho.

tkroll

2:44 pm on Jul 2, 2003 (gmt 0)

10+ Year Member



It seems like the concensus here is that it does matter?

Is it possible to use a rewrite rule in .htaccess in my top-level directory to have all requests to [domain.com...] go to [domain.com...]

I'd like to avoid any PR sharing among the slashed and unslashed.

Thanks for the time!

Mohamed_E

3:10 pm on Jul 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> Does Google care about the trailing / in a url?

I have an information site, and most people link to me spontaneously, so I have no control over how they link.

Checking my backlinks on Google with:

link:my.domain.com
link:my.domain.com/
link:my.domain.com/index.html

gives me exactly the same number of links. So I strongly suspect that it does not matter which is used. That said, when you do have control, consistency is good on general principles.

tkroll

3:20 pm on Jul 2, 2003 (gmt 0)

10+ Year Member



Thanks Mohamed_E. That is really what I assumed as Google seems smart enough to figure this out.

What confuses me is that when I type [domain.com...] or [domain.com...] into the address bar I get the same PR in GTB 2.0. But when I click from within search results I get a grey bar. Does this have to do with the PR relative to my search?

Thanks.

pageoneresults

3:23 pm on Jul 2, 2003 (gmt 0)

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



I'm with buckworks on this one. Your URIs should have a trailing slash where applicable.

Adding the "/" reduces the load on your Web server by removing an unnecessary page request. This reduces the load time of every page being served.

It is a very minimal load but add that up over the number of pages being requested. A well formed URI (Uniform Resource Indentifier) will have a trailing slash when pointing to a root level page.

www.example.com/foo/

Now, there may be instances where www.example.com/foo returns a different resource other than a default page for that directory. In that case, the trailing slash should not be there.

P.S. Pay close attention to what your browser is doing when you type in a URI that does not have a trailing slash and points to a default file for a directory. In most instances, the server responds and adds the trailing slash.

tschild

4:36 pm on Jul 2, 2003 (gmt 0)

10+ Year Member



One remark re the overhead to the server when a redirect to the URL with slash:

this is only relevant for directory URLs, not for the main URL under the domain.

a) main URL of a server:

for the URLs

[example.com...]
[example.com...]

the browser will send the exact same HTTP request


GET / HTTP/1.1
Host: www.example.com

b) directory URL:

for the URLs

[example.com...]
[example.com...]

the browser will send two different HTTP requests:


GET /directory HTTP/1.1
Host: www.example.com

in the first case, and


GET /directory/ HTTP/1.1
Host: www.example.com

So it's only directory URLs which are relevant in the 'to slash or not to slash' context.