Problem / Motivation

The Domain Alias module currently allows creating multiple aliases for the same environment on a single Domain entity. This can lead to unpredictable behavior, as Drupal arbitrarily selects the first matching alias when loading a domain. This affects both web requests and Drush commands.

Proposed Resolution

  • Prevent creation of more than one alias per environment per Domain entity.
  • Add form/API validation to enforce this rule.
  • Optionally, show an alert or warning in the admin UI when conflicts exist.
  • Update documentation to clearly state that only one alias is allowed per environment.

Benefits

  • Removes ambiguity in domain resolution.
  • Ensures predictable behavior for both web and CLI requests.
  • Improves clarity and maintainability of Domain Alias configuration.

Remaining Tasks

  • Implement validation for creating/editing Domain Alias entities.
  • Provide a way to detect and resolve existing conflicts in the configuration.

Issue fork domain-3557218

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

mably’s picture

Not sure we want to enforce a unique alias per environment as it may be too restrictive for some people.

Postponing for now.

mably’s picture

Status: Active » Postponed (maintainer needs more info)
mably’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Closing as domain alias ordering have been added to 3.x.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.