Page is a not externally linkable
- Google
-- Google SEO News and Discussion
---- Canonical Tag vs. Block in Robots.txt


g1smd - 11:49 pm on Apr 25, 2011 (gmt 0)


aakk9999: 301 would be a long job, i am not too much into coding and as you said there might be some other spelling or some other kind of mistakes and such URLs can pop out.

If this is a scripted page (PHP or whatever) then the fix for the entire site might boil down to half a dozen lines of code.

This is especially true if there is a simple and consistent all-lower-case or Camel-Caps-With-Hyphen format supposed to be in use for all HTML page URLs.

BEFORE the point in the PHP script where the DOCTYPE is sent out to the browser, sniff the requested URL path part and store it in a variable (say $uriPathRequested) and then use your "URL formatting rules" to generate another internal variable (say $uriPathCanonical) with the capitalisation and hyphenation (and any other URL path problems) fixed. Next, compare the two variables. If the values are different, immediately send the server 301 redirect header and the redirected-to URL and quit.

If the value of the $Requested and $Canonical variables are the same, proceed to requesting content from the database. If there is no matching record in the database (because of a misspelling in the requested URL) then immediately send the HTTP 404 Not Found header and the HTML content for the 404 error page.

If content is found in the database, build the HTML page and send it.

This self-fixing system is incredibly easy to implement if your site has been built in a modular fashion and the designer has separated function from presentation.

It is even easier to implement if the canonical URL has an ID number at the beginning of it, such as
www.example.com/1428383-this-fantastic-product as then you can then deliberately post links like example.com/1428383 to Twitter and other places knowing that your site will automatically redirect the request to the correct URL.


Thread source:: http://www.webmasterworld.com/google/4302977.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com