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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Danny.Wouters created an issue. See original summary.

Danny.Wouters’s picture

Status: Active » Needs review
FileSize
1.3 KB

The 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

ruudvanoijen’s picture

Status: Needs review » Reviewed & tested by the community

Tested 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.

  • paulvandenburg committed dae2969 on 7.x-1.x
    Issue #2927729 by Danny.Wouters: Redirect with alias on different domain
    
paulvandenburg’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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