Forum Moderators: open
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.
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!
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.
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.
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.
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.