Which is better for SEO and page rank?
mysite.com/directory/my-page
OR
mysite.com/directory/my-page/
I know the above two URLs are treated as two separate pages by search engines, but I'm stuck on deciding which format to consistently use and w开发者_如何学运维hich is better.
Thanks,
Ham
Matt Cutts (head of Google’s Webspam team) prefer trailing slash.
http://www.mattcutts.com/blog/seo-advice-url-canonicalization/
Anyway, the most important thing is pick one and stick with it uniformly. Do a 301 redirect for user if needed.
Google does not care about trailing slash. Here is their official answer.
http://googlewebmastercentral.blogspot.fr/2010/04/to-slash-or-not-to-slash.html
Google treats each URL above separately (and equally) regardless of whether it’s a file or a directory, or it contains a trailing slash or it doesn’t contain a trailing slash.
Matt is just stating his personal preference quoted in the other answer, not the official preference of Google, which is neither.
.htaccess redirecting to trailing slash urls
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [L,R=301]
both should be equal regarding SEO (as long as you keep consistency) but tend to have different meanings for the user :
mysite.com/directory/my-page would be the URL to a page while : mysite.com/directory/my-page/ would be the URL to the index of a directory.
these being only habits since you can rewrite any URL you want the way you want...
精彩评论