Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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
Comment #1
nicholasThompsonAs 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...
... 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
Comment #2
nicholasThompsonFix 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.
Comment #3
nicholasThompsonFixed in DRUPAL-5.