Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Any chance of getting this ported to Drupal 6.x?
Comment | File | Size | Author |
---|---|---|---|
#27 | global_redirect_endless_loop.patch | 1.82 KB | hass |
#22 | global_redirect_endless_loop.patch | 1.78 KB | hass |
Comments
Comment #1
nicholasThompsonThere certainly is a chance. All I need is a little time to try out Drupal 6.x... I was under the impression that some menu stuff chx did would have made Global Redirect obsolete. I shall investigate :-)
Comment #2
singpolyma CreditAttribution: singpolyma commentedThe links in the menu are changed to the proper 'nice' URL, but if you go to /node/ID it does not redirect...
Comment #3
hass CreditAttribution: hass commentedEDIT: Any progress here?
Comment #4
nicholasThompsonI assume Process == progress? ;-)
I'm going to work on this today... :-)
Comment #5
hass CreditAttribution: hass commentedFine... :-) You might get no fun with hook_boot... (url() and path alias functions are not available at this bootstrap) and this could end up with using hook_init as today... :-(.
Comment #6
nicholasThompsonIts ported and working...
Comment #7
hass CreditAttribution: hass commentedCool. Are you able to add a 6.x-1.x-dev build to the project page, please? :-)
Comment #8
nicholasThompsonI'd love to but I can quite see how ;-)
I've created the project node for it and 6.x-dev is appearing in the releases part of the project....
Comment #9
hass CreditAttribution: hass commented1. Open http://drupal.org/project/globalredirect
2. click "Add new release"
3. select the branch
4. click next... wait until 14:00 or 2:00 :-).
Aside the D6 version totally break my site... it redirect paths that shouldn't be redirected and therefor break everything.
Comment #10
nicholasThompsonI've added the release already - http://drupal.org/node/202035
Its odd how it broke your site - i tested it on a dev version of D6 (HEAD) which I checked out about 5 minutes before getting GR to work. I tested it on nodes with and without aliases. I also had it working with clean and unclean URL's (ie, unclean redirecting to clean).
I'll check my dev version again...
Comment #11
hass CreditAttribution: hass commentedEvery click i do ends up in a redirection failure. Admin section becomes inaccessible, batch api breaks on module activation and so on.
Comment #12
nicholasThompsonAre you using the latest HEAD of D6 or RC1?
Comment #13
nicholasThompsonI can confirm that GR is working on my HEAD version of D6. I just rechecked out Drupal HEAD and GR (DRUPAL-6--1) and admin is perfectly usable for me - and urls with aliases redirect correctly...
Is this the version you are using?
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/globalredir...
Comment #14
hass CreditAttribution: hass commentedSorry, it is broken. I used the DRUPAL-6--1 from CVS. If i activate the module i get an endless loop. Remember - we have had this in past, too.
Comment #15
nicholasThompsonHmmmm....
I do recall this in the past - but that was to do with GR ignoring the destination argument.
I notice you're using IIS - I use Apache (on RedHat)... I wonder if this has anything to do with it...
Are you using Clean URL's?
Comment #16
hass CreditAttribution: hass commentedYes, clean URLs are activated.
Comment #17
hass CreditAttribution: hass commentedI gave clean url setting a try and if disabled it works.
Comment #18
hass CreditAttribution: hass commentedOk, the source if this bug is this line...
I remember IIS will every time show '?q=' to the PHP script with ISAPI Rewrite... cannot say for sure now, but i debugged this in past for something else and learned there is a difference between Apache and IIS with ISAPI Rewrite. See http://api.drupal.org/api/function/request_uri/6 about the difference. Apache gives you the clean URL as variable and all other webservers not... therefor the request_uri() does not contain '?q=', but does on all other webservers.
Comment #19
hass CreditAttribution: hass commentedAside, this is why we use JS in D6 to detect clean URLs for all servers for sure... prior Drupal releases have made us to add an hardcoded line to settings.php telling Drupal to turn on clean_urls (
$conf['clean_url'] = 1;
).Therefor the check in system.admin.inc line 1681 continuously fails on non Apache servers.
Comment #20
nicholasThompsonBugger!
Ok - so the question now is how to get IIS to test if the URI is clean or not clean if clean_url is enabled. IDEALLY it'd be nice to not have to use JS to do this...
Unfortunately, I do not have IIS installed. Does WinXP Pro come with IIS? I have a parallels install with WinXP Pro on it...
PS: Do you use Skype or anything?
Comment #21
nicholasThompsonBloody Firefox didn't refresh the form!
Comment #22
hass CreditAttribution: hass commentedPatch attached that fixes this bug.
Comment #23
hass CreditAttribution: hass commentedYes, IIS comes with WinXP Pro.
Comment #24
nicholasThompsonLooks good - I'll give that a go (just about to go out)....
Just out of interest, is there any reason why you're using 'strstr' instead of 'strpos'?
There is also the 'issue' of what happens if you're using a server which isn't Apache or IIS (does LightHTTP claim to be an apache derivative?) - Is it safe to assume that any non-IIS server will react in the same way as IIS? If so - then we could switch that arround and check for IIS and just to a 'catch all' else as an alternative...
Thanks for the patch Hass!
Comment #25
hass CreditAttribution: hass commentedI figured out any problem with forms not saved... let's do some more testing... maybe limit this redirection to GET only.
Well we could limit this to IIS... but we have the risk to be broken on other servers, too. The way you get the variable is only provided by mod_rewrite. If other rewrite plugins works different it get's broken again.
Comment #26
hass CreditAttribution: hass commentedMay i ask you - if this POST data not saved problem is a general problem!?
Comment #27
hass CreditAttribution: hass commented1. Added method GET, but i'm not sure of this is save for GET forms... only tested with POST forms.
2. Changed strstr to strpos.
If you'd don't like to be save, this code may work as expected (untested).
Or we need to turn off the last redirect check on IIS at all.
Comment #28
nicholasThompsonComment #29
nicholasThompsonCould we maybe do a check at the beginning of hook_init to check if $_POST is empty? We obviously cant check if $_GET is empty because of '?q='... But if there is something in $_POST then we never want to interrupt it with a redirect.
I'm not 100% sure what the problem is here though... Would you mind explaining what exactly goes wrong?
Comment #30
nicholasThompsonGR does an empty check on $_POST now. If there is ANYTHING in $_POST, then GR doesn't do any redirecting. Hopefully this will solve this issue...
Comment #31
hass CreditAttribution: hass commented@nicholas: I don't think so... if you do a
strpos(request_uri(), '?q=')
on the URL you are running an endless loop... Not sure what ISAPI version I've used in past, but I'm sure this is also the case with the newest version. I will give it a try again and keep you posted. See #18.Comment #32
hass CreditAttribution: hass commented#348872: Add REQUEST_URI compatibility for IIS ISAPI_Rewrite
Comment #33
JeremyL CreditAttribution: JeremyL commentedHow are things going to get this all fixed & integrated either into GR or back into Drupal. I can still not use GR on my D6 / IIS site.
Comment #34
berarma CreditAttribution: berarma commentedHi.
I'm having this problem with Apache. :S
These are the headers as reported by Live HTTP Headers:
HTTP/1.x 302 Moved Temporarily
Date: Sat, 11 Jul 2009 00:07:03 GMT
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux)
Cache-Control: store, no-cache, must-revalidate, post-check=0, pre-check=0, no-cache
Expires: Sun, 19 Nov 1978 05:00:00 GMT
X-Powered-By: PHP/5.2.6
Location: http://www.xxxxxxxxx.com/content/xxxxxxxx
Content-Type: text/html; charset=iso-8859-1
X-Cache: MISS from Accel0
X-Cache-Lookup: MISS from Accel0:8080
Connection: close
Note the reported Apache version and the 302 response code. I've confirmed that the request_uri() function returns the non-clean url, thus it enters and endless loop.
Comment #35
chicagomom CreditAttribution: chicagomom commentedHas anyone tested this with IIS7 and the URL Rewrite module?
Comment #36
p4trizio CreditAttribution: p4trizio commentedI have D6 and IIS7 on windows server and it's working fine
Comment #37
hass CreditAttribution: hass commentedComment #38
specialdefect CreditAttribution: specialdefect commentedThank you post #27, I used your code and modified it to work with the most recent version of Global Redirect 6.x-1.2. We're on IIS6, Drupal 6. Thanks again!
Line 153 of /globalredirect/globalredirect.module
Comment #39
jerry CreditAttribution: jerry commentedSubscribing.