Using URL aliases makes URLs case insensitive

guitarmiami - June 28, 2008 - 22:03
Project:Path
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

If you use the path module for URL aliases, the aliases are case insensitive. This is bad for SEO because search engines see two different URLs as being different pages of duplicate content.

Example:
http://www.google.com/index.html
http://www.google.com/index.HTML

Example:
drupal.org/handbook
drupal.org/handBOOK

[copy and paste the above URLs; I don't want to create links]

URLs should be case sensitive.

#1

guitarmiami - June 29, 2008 - 00:27

Lines 223 - 231 in Drupal 5.7 Path module:

      case 'load':
        $path = "node/$node->nid";
        // We don't use drupal_get_path_alias() to avoid custom rewrite functions.
        // We only care about exact aliases.
        $result = db_query("SELECT dst FROM {url_alias} WHERE src = '%s'", $path);
        if (db_num_rows($result)) {
          $node->path = db_result($result);
        }
        break;

Is it a MySQL problem?
http://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html
http://www.delphifaq.com/faq/databases/mysql/f801.shtml
http://mysqldatabaseadministration.blogspot.com/2006/09/case-sensitive-m...

#2

guitarmiami - October 12, 2008 - 00:33

I've written a longer article about this problem here with some images.

#3

luron - December 19, 2008 - 22:22

subscription

 
 

Drupal is a registered trademark of Dries Buytaert.