Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- A guide to fixing duplicate content & URL issues on Apache


jdMorgan - 10:46 pm on Jan 4, 2007 (gmt 0)


The problem is that you don't know what URLs will be linked-to by other sites or typed-in by people to reach your site. If someone types in "Example.com/Index.html" to get to your site, what will happen?

On most sites using all-lowercase filenames, you'll get a 404-Not Found error. If that's the result of a link from another site, then any PageRank or link-popularity ascribed to the link by search engines will be lost. If it's the result of a bad link or of a person typing-in URL incorrectly, then it's an unpleasant surprise for the user, and becomes a usability issue.

With the lowercasing code in place, all such requests will be lowercased and redirected to the URL-path which actually resolves to a file -- /index.html. This avoids the 404-Not Found error for improved usability, and passes the PageRank/Link-pop from even incorrectly-typed links to the correct page.

The reason that I made it a "plug-in" is that it is big, slow, and may have to "call itself" several times, making it even slower. I suggest including it only if needed to solve an existing problem with other sites incorrectly linking to your site with uppercase letters in the URL, or if many people type-in URLs to get to your site with uppercase letters.

If you have access to server config files, this is so easy/fast to fix; You just define a RewriteMap to call the system's "tolower:" function, and do:

RewriteRule (.*[A-Z].*) http://www.example.com/${myToLowerMap:$1} [R=301,L]

But that option isn't available in .htaccess, unless your host has pre-defined the tolower RewriteMap for you, and told you what its map name is.

Jim


Thread source:: http://www.webmasterworld.com/apache/3208525.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com