I've installed Global Redirect 6.x-1.0 at my D6.5 site, Apache/2.2.3 (FreeBSD) mod_ssl/2.2.3 OpenSSL/0.9.7e-p1 DAV/2 PHP/4.4.4 with Suhosin-Patch.

Modules I use:

Standard
Aggregator 6.5
Book 6.5
Color 6.5
Comment 6.5
Content translation 6.5
Database logging 6.5
Help 6.5
Locale 6.5
Menu 6.5
Path 6.5
PHP filter 6.5
Poll 6.5
Profile 6.5
Search 6.5
Statistics 6.5
Taxonomy 6.5
Throttle 6.5
Update status 6.5
Upload 6.5

And non-standard
Smfforum 6.x-1.2
Menu breadcrumb 6.x-1.1

So I installed Global Redirect module and site immediately stopped working, every link led to some redirection cycle. I checked the code, to find which part of it do this cycle redirection. So after commenting the part which makes comparing the request to the alias, everything start working except the module main functionality. This is the part of the code:

    // Compare the request to the alias. If we have a language prefix then prefix the alias and compare. This also works as a 'deslashing' agent too
    if ((empty($language->prefix) ? $alias : $language->prefix .'/'. $alias) != $_REQUEST['q']) {
      drupal_goto($alias, $query_string, NULL, 301);
    }

It was not suitable for me and I started to find a way to make it works. In 6.x development branch I've found another example of this part of the code:

    if ($_REQUEST['q'] != $prefix . $alias) {
      drupal_goto($alias, $query_string, NULL, 301);
    }

After changing the old code to the new one from 6.x-dev version everything start working: slash removing, alias redirection and front page redirection.

So now this part of my globalredirect.module looks like this:

    // Compare the request to the alias. If we have a language prefix then prefix the alias and compare. This also works as a 'deslashing' agent too
/*    if ((empty($language->prefix) ? $alias : $language->prefix .'/'. $alias) != $_REQUEST['q']) {
      drupal_goto($alias, $query_string, NULL, 301);
    }*/

    if ($_REQUEST['q'] != $prefix . $alias) {
      drupal_goto($alias, $query_string, NULL, 301);
    }

Anything else remains intact.

And the questions are:

Is it right to use this patched version of the module at the production site? Will this version work as good as original 6.x-1.0 version? Maybe it's time to make 6.x-1.01 version or something like this?

Comments

dzhu’s picture

Assigned: dzhu » Unassigned

Some additional information:

Maybe this somehow connected to using the localization language, like in this issue:
http://drupal.org/node/322271

Because I use localization (Russian language) for whole site, but there is no language choice option for users and administrators.

And after reading this issue:
http://drupal.org/node/216271

I've tried to use current development snapshot 6.x-1.x-dev 2008-Sep-16 (but without globalredirect_admin module), and everything seems working fine. But I do not know which case is more risky, to use stable 6.x version with that simple patch, mentioned in my issue or to use development version... Anyway, I prefer to use patched stable version. Can somebody advice me something about all these?

tingeltangeltill’s picture

thx very much, it also worked for my site!

Vayira’s picture

I have the same problem... my site uses spanish

Hervé Saladin’s picture

I had the same problem (my site is in french).
The patch works fine.
Thank you dzhu

nicholasThompson’s picture

Status: Active » Fixed

6.x-1.x-dev will be the 1.1 release very soon.... Marking as fixed as dev fixes this problem.

Status: Fixed » Closed (fixed)

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