Redirect Loop and custom_url_rewrite ignored

WildBill - December 14, 2008 - 17:01
Project:Global Redirect
Version:6.x-1.2
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:needs review
Description

Hello there,

I just upgraded from Drupal 5.x to 6.8, and in the process I also upgraded to the 6.x-1.0 version of Global Redirect. It caused every page except for the front page to be completely inaccessible (Redirect Loops). I couldn't even turn GR off. I finally had to delete it manually via FTP. I uploaded the 6.x-1.x-dev version, and that appears to have fixed the problem.

Just wanted to share my experience in the hopes it might be helpful.

Cheers.

#1

avolve - December 15, 2008 - 07:17

i just noted this with MAMP - i had to delete the module to access the modules pages (i did not try any other pages). Was not upgrading this module, just installing it. Got a message in FF about the loop...

#2

WildBill - December 15, 2008 - 17:55

Forgive me - what does MAMP stand for?

#3

nicholasThompson - December 15, 2008 - 18:17

Just as LAMP is "Linux, Apache, MySQL, PHP", MAMP is the same for Mac OS X (Mac, Apache, MySQL, PHP).

#4

nicholasThompson - December 16, 2008 - 04:52
Status:active» fixed

As 6.x-1.x-dev fixed the issue and that is going to become 1.1 as soon as this issue queue is sorted, I'm marking this as fixed.

#5

System Message - December 30, 2008 - 05:00
Status:fixed» closed

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

#6

guaka - March 6, 2009 - 12:30
Status:closed» active

I'm running the latest version of Global Redirect on Drupal 6.10 on a multi-site install. On some sites Global Redirect is giving me the redirect loops, but not on other sites.

The redirect loops occur almost everywhere in the site, apart from the main page. This is probably the reason that Global Redirect doesn't show up in update.php either. Could this be part of the problem?

#7

xaviercas - March 10, 2009 - 21:49

Drupal 6.10
MySQL database 5.0.51a
PHP 5.2.6
Web server Zeus/4.3
Global Redirect 6.x-1.2
Path enabled
Pathauto installed not enabled

Hi,

I am also getting redirect loops. All running ok now that GR has been disabled, after having not been able to access the site . Now, when I try to enable the module, it causes the same problem, not even going through the 'save configuration' process. Thanks.

#8

guaka - March 14, 2009 - 19:33

It could be related to the web server. I am running nginx. Is anyone running Apache encountering this issue?

#9

Clemens - May 27, 2009 - 05:11
Version:6.x-1.0» 6.x-1.2

Confirming the Redirect Loop issue in Drupal 6.12 with Global Redirect 6.x-1.2 and Pathauto 6.x-2.x-dev on Apache.

Turn Global Redirect OFF and all is OK again.

Edit: added reference to Apache.

#10

WildBill - May 29, 2009 - 02:19

I'm using Global Redirect 6.x-1.x-dev with Pathauto enabled, and I'm not having the Redirect Loop issues. However, I don't believe my Pathauto and Drupal core are up-to-date right now (my site is in development).

That said, the dev version appears to have fixed this problem.... so are we planning to roll this fix into the official release?

#11

xaviercas - June 2, 2009 - 07:00

Drupal 6.12
MySQL database 5.0.51a
PHP 5.2.6
Web server Zeus/4.3
Global Redirect 6.x-1.x-dev

I have installed GR 6.x-1.x-dev and had the same problem as before: redirect loop. Deleted the module via ftp as I could not access the site.

#12

hongbo - June 4, 2009 - 07:43

I notice one case it will loop:

A url rewrite is added in .htaccess to add a slash at end of the language prefix, such as to change http://domain.com/en to http://domain.com/en/

Because globalredirect will remove the end slash after language prefix regardless if the 'deslash' option is on of off.

I have made a patch to preven globalredirect from removing the end slash after language prefix.

http://drupal.org/node/481690

#13

smk-ka - June 21, 2009 - 17:29
Title:Redirect Loop in 6.x_1.0» Redirect Loop and custom_url_rewrite ignored
Priority:normal» critical
Assigned to:Anonymous» smk-ka
Status:active» needs review

This module is missing critical updates that happened between Drupal 5 and 6:

1. It completely ignores language in calls to drupal_get_path_alias() and the $alias_sensitive query
2. custom_url_rewrite() was formerly triggered by drupal_get_path_alias(), since D6 you have to do it manually (see url() function as reference).

By not correctly re-assembling the URL to compare to, this module breaks other modules like Sub-path URL aliasing (issue).

AttachmentSize
globalredirect-D6.patch 1.54 KB

#14

PlayfulWolf - July 10, 2009 - 19:42

seems that this patch still haven't made to dev version :(

#15

mrfelton - July 11, 2009 - 21:19

Patch fixes the issue for me (using Sub-path URL), thanks.

#16

phd_hiren - July 15, 2009 - 09:54
Status:needs review» reviewed & tested by the community

thanks smk-ka

I was having problem when Global Redirect and Subdomain modules are together.

Patch in #13 works for me too.

#17

jcmarco - July 19, 2009 - 08:26

Tested and working fine.
I had problems with subpath_alias module and now it works fine.

#18

nicholasThompson - July 19, 2009 - 08:40

I'll try to commit this patch to 6.x-dev this weekend.

Cheers for all the reviews guys!

Nick

#19

mczenko - July 21, 2009 - 23:20

Works great ! Thanks !

#20

Steven Jones - July 23, 2009 - 12:35

This patch doesn't fix the problem when used with PURL, as in #527490: PURL + Path Aliases = Redirect loop, in fact it makes it a little worse.

#21

a.a.egoroff - July 25, 2009 - 21:28

Tested on D6.13 with:
path.module
subpath_alias.module
url_alter.module

Also tested with hardcore aliases:) admin/* -> panel/*, node/* -> contents/*… altered subpaths:
/panel/build/menu (/admin/build/menu)
/panel/build/block (/admin/build/block)

all many others work fine!
Thanks a lot!!!

#22

jcruz - July 28, 2009 - 00:24

Patch #13 works for me.

Tested with:
Drupal 6.13
pathauto 6.x-1.1
globalredirect 6.x-1.2
subpath_alias 6.x-1.0

#23

klonos - August 13, 2009 - 21:52

Hey people, I am having issues too with:

Drupal 6.13
pathauto 6.x-1.1
globalredirect 6.x-1.x-dev or 6.x-1.2
subpath_alias 6.x-1.0

Is this patch included in latest dev build (6.x-1.x-dev, 2009-Jun-12)?

If not, how do I apply it?

Can it only be applied on 6.x-1.2 or does it also work on 6.x-1.x-dev?

Can anyone provide an already patched version of either the dev build or the 6.x-1.2 pretty please?

#24

mdih - August 14, 2009 - 20:04

Patch #13 works for me.

Tested with:
Drupal 6.13
pathauto 6.x-1.1
globalredirect 6.x-1.2
subpath_alias 6.x-1.0
url alter 6.x-1.0
Path redirect 6.x-1.0-beta4

To apply patch manually: http://drupal.org/node/534548

#25

dinwath - August 19, 2009 - 21:24

Patch #13 works for me.

Tested with:
Drupal 6.12
pathauto 6.x-1.1
globalredirect 6.x-1.2
subpath_alias 6.x-1.0
url alter 6.x-1.0

Thanks a lot!!!

#26

tim.plunkett - September 15, 2009 - 18:41

#13 works!
Drupal 6.13
globalredirect 6.x-1.x-dev
pathauto 6.x-1.x-dev
subpath_alias 6.x-1.0
url_alter 6.x-1.1

Thanks!

#27

xjm - October 2, 2009 - 21:32

Applying the patch in #13 resolved the issue for me as well. I guess we're listing our module versions here so:

Drupal 6.14
Global Redirect 6.x-1.2
Path Redirect 6.x-1.0-beta4
Pathauto 6.x-1.1
URL alter 6.x-1.1
Sub-path URL Aliases 6.x-1.0

#28

lort - October 10, 2009 - 21:30

patch attached to #13 works for me too.

Drupal 6.14
Global Redirect 6.x-1.2
Path Redirect 6.x-1.0-beta4
Pathauto 6.x-1.1
URL alter 6.x-1.1
Sub-path URL Aliases 6.x-1.0

#29

BenK - October 12, 2009 - 21:24

Subscribing....

#30

crea - October 26, 2009 - 03:52

subs

#31

Dave Reid - October 31, 2009 - 01:24
Status:reviewed & tested by the community» needs review

Can someone try with some revised logic that matches how the url rewriting works in D7?

    $original_request = $request;
    if (function_exists('custom_url_rewrite_outbound')) {
      // Modules may alter outbound links by reference.
      custom_url_rewrite_outbound($request, $options, $original_request);
    }

    // Aliases should always take precendence over any altered URLs.
    $alias = drupal_get_path_alias($original_request, $options['language']->language);
    if ($alias != $original_request) {
      $request = $alias;
    }

#32

tim.plunkett - November 4, 2009 - 20:47
Assigned to:smk-ka» Anonymous

Patch? I'm not exactly sure if should modify or replace the patch provided, so I'm hesitant to vouch for it, but it makes sense.

 
 

Drupal is a registered trademark of Dries Buytaert.