Msg#: 4052903 posted 2:49 pm on Jan 2, 2010 (gmt 0)
I've discovered that Google's bots seem to be unable to properly follow URLs that encode colons (':') as %3A. It seems that Google insists on replacing the '%3A' with a ':' before following the link. This creates concatenation problems as I'm found other cases where links could not be properly followed by others if they use a ':' instead of '%3A'.
For example if the urlencoded URL http://example.com/foo/widgets%3A%20blue.html was in a site map, Google would follow it as http://example.com/foo/widgets:%20blue.html.
In order to prevent duplicate content penalties and in an effort to try and concatenate all pages to a single page I had coded a 301 redirect from URI requests containing ':' to URIs using '%3A'. This threw Google into a circular redirect as Google's bot would still make its request using ':'.
My method for dealing with this issue has been to stop redirecting requests with URIs containing ':' to URIs using '%3A' and instead using the following in my HTML header:
<link rel="canonical" href="http://example.com/foo/widgets%3A%20blue.html"> Where the URL above is replaced with a properly urlencoded reference for the page in question.
Msg#: 4052903 posted 6:48 pm on Jan 2, 2010 (gmt 0)
The take-home lesson here is to avoid "special characters" in the URL-path-part of a URL. You can use these special characters more freely in the query string part (always-encoded if need be), but the URL-path-part has many more restrictions [tools.ietf.org].
Like it or not we are *not* free to use 'just any' characters anywhere we want in URIs.
Msg#: 4052903 posted 8:28 pm on Jan 2, 2010 (gmt 0)
This is a really old part of my site. Basically it is using some rewrite rules to convert the URL into a query string. For instance behind the scenes, http://example.com/foo/widgets%3A%20blue.html is handled as http://example.com/index.html?foo=widgets%3A%20blue
It is actually a chemical database, with each chemical name being the "filename". This lead to some really messed up file names, but like I said this section of my website is almost ten years old so there is a limit to what I can do to fix things without taking some serious SERP hits.
Remember way back when I added this section of my site, query strings weren't treated as nicely by search engines as were "real" web pages so it was important to rewrite queries into the main URI. Even today there is debate whether one should rewrite queries into the main URI.
Msg#: 4052903 posted 4:07 am on Jan 8, 2010 (gmt 0)
Pathinfo wouldn't resolve my stupid encoded character issue and the query strings work just fine. They are hidden from users since I'm using RewriteRule and any changes to the design of the site in this matter would be drastic beyond measure.
As they say, don't fix what ain't broke. The stupid %3A issue was a break that had to be fixed, but that wasn't a RewriteRule problem.