Download & Extend

"Case sensitive URL Checking" only working for autenticated users

Project:Global Redirect
Version:6.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)

Issue Summary

I'm having a problem whereby authenticated users are redirected, but anonymous users are not. Deslashing and non-clean to clean redirect appropriately, but changing case in URLs does not redirect to the configured alias unless a user is logged in

Comments

#1

I have the same problem on my site. the redirect works, but the 301 was only send to authenticated users.

#2

Status:active» postponed (maintainer needs more info)

I cannot replicate this with the dev branch...

Can you please elaborate on server and OS details? Is this still a problem? Do you have example URL's?

#3

I just ran into this problem with 6.x-1.2. What kind of debugging info do you need to track down this problem? Which modules could interfer here?

#4

Is the cache on? Maybe the anonymous users are getting a cached page before global redirect gets a chance to do it redirects?

#5

Yes, in my case I have normal caching mode, also enabled CSS and JS caching.

#6

BTW, this check (in globalredirect.module) is completely broken:

<?php
 
// Alias case sensitivity check. If there is an alias from the previous
  // lookup, do a query to test for case.
  // NOTE: This test depends on the coalition of the table being case-insensitive (ending _ci).
 
if ($alias && $settings['case_sensitive_urls']) {
   
$alias_sensitive = db_result(db_query("SELECT dst FROM {url_alias} WHERE dst = '%s' AND language = '%s'", $alias, $langcode));
    if (
$alias_sensitive && $alias != $alias_sensitive) {
     
// There is a match and there is a difference in case.
     
$alias = $alias_sensitive;
    }
  }
?>

The problem is (besides relying on the settings of DBMS) the language code. The current page may have the concrete language or may be language neutral (we don't know exactly at this moment). Therefore one check: language = '%s' is not enough.

#7

This is not quite correct also:

<?php
$langcode
= isset($options['language']->language) ? $options['language']->language : '';
?>

Should it be like this?
<?php
$langcode
= isset($options['language']->language) ? $options['language']->language : $language->language;
?>
nobody click here