Suppose we have the following situation on a multi-domain site. We have a node with the title 'foo' on domain-a and a node with the title 'foo' on domain-b. After creating/saving these nodes we have the following two url aliases
* domain-a/1234 --> domain-a/foo
* domain-b/2345 --> domain-b/foo
If we edit node 1234 and change the title to 'bar' we have a redirect from 'foo' to 'bar'. But here we have a problem since the redirect module only checks on the alias of a node and not on the domain.
If we go to domain-a/foo we are redirected to domain-a/bar as we should expect. However if we go to domain-b/foo we are also redirected to node/1234 on domain-a. Depending on the settings of the site we receive an access denied or a warning.
Comment | File | Size | Author |
---|---|---|---|
#2 | dvg-redirect-with-alias-on-different-domain-2927729-1.patch | 1.3 KB | Danny.Wouters |
Comments
Comment #2
Danny.Wouters CreditAttribution: Danny.Wouters at ezCompany commentedThe following patch implements hook_redirect_load_by_source_alter().
In this hook we can check if the redirect is on the current domain. We remove the redirect if the target node is on a different domain
Comment #3
ruudvanoijen CreditAttribution: ruudvanoijen commentedTested this on a multidomein site with dvg. This patch fixes the problem. It should indeed return a 404 because on that domain the page doesn't exist. Instead of an access denied or a warning.
Comment #5
paulvandenburg CreditAttribution: paulvandenburg at ezCompany commented