After enabling this module, I got an infinite redirect to

http://www.site.com/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/user/1
etc., Firefox killed it, but you get the point.

The reason is, although my site is i18n (2 languages) the site's language detection is based on user-setting only, it never uses a prefix like /en or /fr.

Comments

Georgii’s picture

I'm having the same problem. Trying to find a solution now, does anyone have any idea?

Georgii’s picture

Status: Active » Needs review

Ended up with deletion of the following line
locale_language_url_rewrite_url($request_path, $options);

pauleb’s picture

+1
Having the same problem with language prefixes. I'll try #2 as soon as possible.

Georgii’s picture

@pauleb
Write back with results please :)

Anonymous’s picture

I tested #2 and it worked for my case.

But I think in some cases the url rewrite is necessary. So we need a "detection" to know when, and when not to call it.

niels_bjorndal’s picture

Has anybody got any further on this subject. I'm currently in the process of setting up a site for a client, and I'm experiensing the problem with the infinite redirect, when I have both I18 and Global Redirect enabled at once.

The problem is directly associated with the path prefix. /en for example. So if I disable this setting, the problems dissapears, so I guess, I could use a domain to detect the language to avoid the problem - but at the moment that is not possibly.

...so anybody got a solid solution to implement?

niels_bjorndal’s picture

I found a patch on this thread: http://drupal.org/node/1034126.

Anonymous’s picture

Status: Needs review » Closed (duplicate)

Ok I assume that works? Marking this as a duplicate of #1034126: Infinite loop (error 310) with i18n in D7

foripepe’s picture

Status: Closed (duplicate) » Active

I put the status of this issue active, because the latest Global Redirect module (7.x-1.5) still has this problem.
Eg. my URL become: nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl

And output in Chrome:

This webpage has a redirect loop
The webpage at http://.../nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl/nl has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.

I have done a hot fix disabling the local_language_url_rewrite_url() function in line 82 in globalredirect.module:

  // Let the locale_language_url_rewrite_url() do it's magic, if preset.
  // TODO: Is this needed anymore?
  if (function_exists('locale_language_url_rewrite_url')) {
    // Note 1 : the locale_language_url_rewrite_url() takes path (by reference)
    //          as the first argument but does not use it at all
    // Note 2 : We use $request_path here as we want the path in an untouched
    //          form (current_path() gets modified by core)
    //locale_language_url_rewrite_url($request_path, $options);
  }
foripepe’s picture

PS. The language detection in my system is "user" and "default", but not "URL":
admin/config/regional/language/configure