i read on Google SEO REPORT CARD that for search engines this page:


is a different page than this one:

http://www.domain.com/somepath/ (note the final slash '/')

Well if this is true i have few questions:

A) Is this true also for home page path i.e. http://www.domain.com.

I mean I already redirect 301 http://domain.com to http://www.domain.com, but how do I redirect also http://www.domain.com to http://www.domain.com/ (with final slash) ??? Actually Apache server or my browser client (don't know who is doing this) seem to already do this sort of redirect becasue if I insert http://www.domain.com in browser bar it always auto adds the final slash making it http://www.domain.com/

So I'm confused, do I need to do anything?

B) Since I still use file extensions, I was not so concerned about redirecting domain.com/somepath to domain.com/somepath/ because all pages in my sites are in the form of somepath/page.htm.

But I noticed anyway a strange thing that is confusing me. If I enter as URL somepath/page.htm the server returns the same page of somepath/page.htm/ (with final slash) instead of an error. I think it's normal because if you look for http://www.php.net/docs.php it returns the same page of http://www.php.net/docs.php/ (final slash), but are these then considered TWO different pages for search engines???

Do I have then to adjust again .htacess in order to redirect 301 each URL with final slash to the same url without the final slash???


  • Canonical URLs help to avoid this confusion
    – John Conde
    Commented Nov 4, 2010 at 1:42
  • @John: That is true but it's best to use 301 redirects where possible. Canonical is just a plaster, it doesn't solve the real problem. Commented Nov 4, 2010 at 13:51
  • The correct way to write the domain address is with trailing slash. Just for the record.
    – DanMan
    Commented Feb 23, 2013 at 19:36

6 Answers 6


Anytime there is a difference in any part of the URL, even if it is capitalization or parameter order, search engines will view it as a unique URL.

A) Yes, they are still different URLs, even if it's the domain. You might find the following code useful for your .htaccess file:

#change RewriteBase to / after transfer
RewriteBase    /

#Redirects non-www to www
RewriteCond %{HTTP_HOST} ^domain.com
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]

B) These are considered different URLs, but you shouldn't be using a trailing slash directly after a file extension even if the browser still interprets it correctly. I don't think I have ever seen a slash directly after a file extension, so I wouldn't worry about it too much unless you yourself are linking to your pages that way. Don't use the slash after the extension.

In general, stay consistent with your URL schemes. Pick one way and stick with it.


Trailing slashes on the domain name are treated exactly the same as no trailing slash, i.e. http://www.domain.com = http://www.domain.com/.

But that's the only exception. Any other time the URL differs, it can return completely different content and thus is treated as a different URL.

Any file returned (with an extension like .htm or .php) should not have a trailing slash. You will find on the Apache server that trailing slashes are usually ignored and the file is returned. This is just how Apache works; the URL example.com/file.php/abc/xyz will go back to file.php, assuming there is no actual file or folder structure like the above.

Directories generally have trailing slashes - again, Apache will automatically 301 redirect to them. For example if you have a folder hello then example.com/hello should redirect to example.com/hello/.

  • Right! I also found this suggested directly by Google that says it's NOT necessary to "add a missing trailing slash to end of domain name or folder name" sine this "will not be needed by most websites" because Apache server already does this. groups.google.com/group/only-validation/web/… Commented Nov 6, 2010 at 17:32

According to Google SEO Guide, and also common sense, website paths resembles to a directory structure.

So, trailing slash denotes some folder root. Power users will also attempt to do the following:

  • user enters through http://domain.com/articles/2009/nice-shoes.htm
  • user will delete last piece to get into a directory listing, like http://domain.com/articles/2009/, hoping to see all articles from 2009.

Adjusting your URLs according to this, will let an hierarchy more clear to crawl and index.

You can make this correction with .htaccess mod_rewrite for both, add or remove trailing slash, according to your needs. Check:



Hope this helps.

  • It would be good to see why I got vote down. Nothing against being vote down when answers doesn't fit, but getting to know why helps everybody, including myself. Commented Nov 4, 2010 at 12:39
  • 1
    +1 For a helpful, technically-accurate answer and strong agreement on the point that downvotes w/o comment are really worse than useless
    – danlefree
    Commented Nov 4, 2010 at 12:57
  • very interesting links. Commented Nov 6, 2010 at 17:34

You can also use the rel=canonical tag to suggest to google the proper URL for their index.


Redirecting to remove the slash is in my opinion the best option, when people link to your site they do it one of two ways, they type out the URL manually in which case they are unlikely to include the trailing slash or they copy and paste in which case the trailing slash would be included, so if you leave the trailing slash up you're likely splitting your links between two URLs (It seems like Google would be sophisticated enough to recognize the two pages are the same, but it's an easy fix so better to be safe then sorry).

If you can't get access to your .htaccess file or redirect these another way then you can use the canonical tag, but it should really be a last resort as it's always better to get your code right then it is to cover it with band-aids.


URLs without the slash are treated as different to URLs with the slash, so in SEO terms, whatever you do, be consistent.

Should you have a slash or not? Of course you should, particularly when dealing with sub-folders.

When requesting http://example.com/foo, the server will first have to look for a resource call foo; when it doesn't find it, it will usually then look for a directory called foo, and if it finds it, it will return the default document.

When requesting http://example.com/foo/, the server knows straight away that foo is a directory, and therefore zeroes in on the default document for that folder.

It's a minor efficiency, but every little helps, IMHO.


  • I think it depents on which Web server you use, and your particular application, whether or not the trailing slash helps in the manner you describe. In my case, with the Scala / Lift-Web application I'm building, the trailing slash does not matter at all, w.r.t. performance: I store the documents in a database not in the filesystem.
    – KajMagnus
    Commented Aug 29, 2011 at 18:21
  • Yeah, this doesn't really affect performance, but you should know what's the difference. With slash -> folder, without -> file.
    – DanMan
    Commented Feb 23, 2013 at 19:40
  • @DanMan Doesn't affect performance? I would have thought the extra 301 redirect would affect performance. From an SEO perspective, it doesn't matter much (Search engines are good at figuring it all out) - providing you are consistent - but from a performance perspective, there is a difference, albeit very minor.
    – CJM
    Commented Feb 24, 2013 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.