Global redirect will be more useful if will redirect path that is cased wrongly to the correct case, i.e. if the alias is MyPage.php and user enter mypage.php, it will redirect to MyPage.php

I added this code to line after 131 to make it does so.

// CASE SENSITIVE REDIRECT
if ( $alias )
{
$alias_sensitive = db_result(db_query("SELECT dst FROM {url_alias} WHERE dst = '%s'", $alias));
if ( $alias_sensitive and $alias != $alias_sensitive )
drupal_goto($alias_sensitive, $query_string, NULL, 301);
}
// END HERE

Comments

nicholasThompson’s picture

Version: 6.x-1.1 » 6.x-1.x-dev

As this is the most recently opened issue, I'll leave this open... But it has been asked before (it seems)... Although I don't remember ever reading the last request!

See: #299399: Case Sensitive Redirects

This is an interesting request and I'd never noticed how Drupal didn't care about case sensitivity before.

Something I think which should be considered is that your query...

SELECT dst FROM {url_alias} WHERE dst = '%s'

... will only work if the collation of the table ends in "_ci".

Please read this for more information:
http://mysqldatabaseadministration.blogspot.com/2006/09/case-sensitive-m...

I'll take a look into adding this to D5 and D6...

Cheers,
Nick

nicholasThompson’s picture

Status: Active » Patch (to be ported)

Fix is committed to Drupal 6.x-1.x-dev. Will be in next major release (along with an entry in the admin page to enable/disable).

Fix/feature needs porting to Drupal 5.

nicholasThompson’s picture

Status: Patch (to be ported) » Fixed

Fixed in DRUPAL-5.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.