Hi,
Thank you for this module, it is really helpfull.
I have multilanguage site (with Internationalization). I tried to configure redirect for node languages between domains but it is not working.
I have two domains:
www.example.comwww.example.ru
I have node http://www.example.ru/node/1 in Russian language. When I try to access this node on other domain (http://www.example.com/node/1) I hoped that page will be redirected to http:///www.example.ru/node/1. Insted of that I was redirected to http://www.example.com/www.example.ru/node/1. Of course, I got 404 error (page not found).
I found this bug and fixed it. Patch that solves this problem is attached.
Thanks for your time.
Best,
Spleshka.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 1653194-12.patch | 592 bytes | Carl Johan |
| #10 | 1653194-10.patch | 756 bytes | matglas86 |
| #6 | global-redirect-node-language-domain-fix-1653194-6.patch | 809 bytes | spleshka |
| #1 | global-redirect-node-language-domain-fix-2.patch | 1.41 KB | spleshka |
| global-redirect-node-language-domain-fix-1.patch | 704 bytes | spleshka |
Comments
Comment #0.0
spleshkaFixed urls filter.
Comment #1
spleshkaI found one more bug there.
If the page URL has an alias, then the browser records the infinite redirect. This bug occurs because you compare URL alias with real URL. See patch for more info (attached).
Comment #2
spleshkaSorry, the second bug was because of "Set Content Location Header" setting. But the first patch is still necessary for the correct redirect.
Comment #3
pvasili commentedThanks for the patch
Comment #4
matglas86 commentedThe
The http:// is to much. Because external is set it already creates a http in front of it. My redirect does not work because of that.
Comment #5
heivoll commentedThe first patch works fine for me. The second, however, introduces redirect loops on all my nodes.
@matglas86: No, the http:// is what's necessary here, and is what the fix consists of. Unless you actually have the http:// set in your language domain settings of course, then you'll get a problem. However, this is not recommended as it would then lock that language to only one protocol (and potentially create other problems I can't think of right now).
The question of protocol here (http vs. https) is relevant though. It shouldn't really be set to http:// statically, but rather be set to the current protocol.
Comment #6
spleshkaAgree with @heivoll. Attached new patch.
Comment #7
heivoll commentedI can confirm that the patch in #6 works fine for me!
Comment #8
heivoll commentedDouble post, sorry.
Comment #9
rreynolds4 commentedI found this at just the right time. Patch #6 seems to be doing the trick for me as well.
Comment #10
matglas86 commentedI found little short route while digging a little deeper. Drupal can handle the correct link building itself when providing the language object to the drupal_goto function.
Comment #10.0
matglas86 commentedFixed bug in html code.
Comment #11
caschbre commentedJust wanted to double check on the patches here... I noticed in patch #6 that it is taking into consideration the protocol (http/https). I'm assuming that the patch only applies this logic for translation-based URLs?
Reason I'm asking is I'm running into issues where globalredirect is switching the protocol on me (http://example.com/?q=some-string --> https://example.com/some-string).
The fix in #6 looks close to what I want but the logic block it is in seems to only pertain when the translation module is enabled. If that's the case then I plan to extract that logic out of that logic block so it applies elsewhere.
Comment #12
Carl Johan commented#10 didn't apply cleanly for me, so just re-rolling.
Comment #13
sumachaa commentedComment #14
chris matthews commentedThe 5 year old re-rolled patch in #12 to globalredirect.module still applies cleanly to the latest 7.x-1.x-dev.