Forum Moderators: Robert Charlton & goodroi
www.example.com/a_directory_name/a_file_name/
But in Webmaster Tools, I'm getting a lot of dup meta & title calls, where Google is making the url case sensitive. For example, the above becomes:
www.example.com/a_Directory_Name/a_File_Name
I don't use the structure anywhere -- so I guess either someone is linking to me in this way, or it's a vaguerie of the Googletron.
I'm not sure how to deal with this -- I can't redirect 301 on a case sensitivity basis... any thoughts?
[edited by: phranque at 11:20 pm (utc) on Dec. 10, 2008]
[edit reason] exemplified urls [/edit]
If you can't redirect (and even if you can) you should ensure internal links are case-sensitive, and that external sites use your desired letter-case. But if no-one links to the URL (not even you) then it's going to have negligible impact on your site or page's performance.
[edited by: Receptional_Andy at 11:33 pm (utc) on Dec. 10, 2008]
I can redirect easily enough (using PHP header), but problem is deciding what to redirect from.
I'm using URL rewriting for the URLs, which I think is complicating things, as there's not a real file that corresponds to the urls that Webmaster Tools is flagging.
For example, if my "real" url is:
www.example.com/apples/oranges/
Google is saying it's finding dup neta/description at:
www.example.com/Apples/OranGes/
and/or
www.example.com/Apples/oranGes/
I can't see how I can 301 redirect this, as any letter in the URL may be upper case. For more "normal" redirects, I do the following:
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.example.com/apples/oranges/");
?>
OK, and what do you do with a URL for which your PHP cannot generate a page -- For example, because no database entry is available for that URL? At this point, you could try converting all characters in the URL to lowercase, and if a database entry can then be found, do a 301 redirect to the all-lowercase URL.
Depending on your server (asked-about above, but not answered), you could probably just blindly redirect any requested URL that contains lowercase characters to an all-lowercase equivalent using mod_rewrite or ISAPI Rewrite. The problem is that you'd be redirecting before knowing whether that lowercase URL is valid (according to your script). So, a request for an invalid URL containing uppercase characters would result in a 301 redirect before a 404-Not Found -- a waste of time, and possibly confusing to robots. As a result, it's probably better to do everything in your script in this case.
Jim
If there's no db entry, then it 301 redirects to the homepage.
What I'm thinking is to compare the urls (php: strcmp) and if there are case differences, then redirect to the lower case version if there are. At least that would avoid 301'ing traffic that is coming to the correct url in the first place.
I have no idea how these upper-case urls have come about in the first place -- frustrating!
OK, well there's another serious problem that needs fixing... This should be a 404-Not Found, not a redirect to the home page. The custom 404 error page can contain links to your home page, html site map, category pages, and a site search function as appropriate, but the server response code should be a 404.
> that would avoid 301'ing traffic that is coming to the correct url...
Of course you wouldn't 301 a correctly-cased URL; If you did, then that URL would redirect-loop endlessly, and the 'page' would become inaccessible.
Any canonicalization problem or URL-error that you do not prevent will likely happen eventually -- through error, incompetence, or malicious exploitation.
For example, once you get this lowercasing function working, then other Webmasters will be less likely to link to the 'bad' URL, because if they type that 'bad' URL into their browser, then your server will send back a redirect to correct it. So, if they then copy-and-paste it, it will have been corrected.
Other common problems [webmasterworld.com]
Jim