This project is not covered by Drupal’s security advisory policy.

Domain Unique Path Alias allows Drupal sites using the Domain
ecosystem to reuse the same path alias across different domains.

By default, Drupal requires path aliases to be unique globally. On a
multi-domain website, this prevents different content from using the same URL
path, even when the content belongs to different domains.

This module makes path aliases unique per domain.

Example

Consider a Drupal installation serving two domains:

domain1.example.com
domain2.example.com

You want both domains to expose a /contact page, but each domain
should resolve it to different content.

Without this module, Drupal prevents the second alias from being created.

With Domain Unique Path Alias:

domain1.example.com/contact → Node 1
domain2.example.com/contact → Node 2

Both aliases can coexist because they belong to different domains.

Duplicate aliases are still prevented within the same domain:

domain1.example.com/contact → Node 1
domain1.example.com/contact → Node 3  ❌


Features

  • Allows the same path alias to exist on different domains.
  • Keeps path aliases unique within each domain.
  • Integrates with Drupal's path_alias entity.
  • Associates path aliases with their corresponding domain.
  • Supports multi-domain Drupal installations using the Domain ecosystem.
  • Supports Drupal 9.4, Drupal 10 and Drupal 11.


How it works

The module extends Drupal's path alias handling with domain awareness.

Path alias uniqueness is evaluated using:

alias + domain

instead of only:

alias

For example:

Alias Domain Allowed
/contact Domain 1 Yes
/contact Domain 2 Yes
/contact Domain 1 No, duplicate


Use cases

This module is useful when:

  • Several domains share the same Drupal installation.
  • Each domain manages its own content.
  • Domains need independent URL structures.
  • Common paths such as /contact, /about,
    /products or /services need to exist on multiple
    domains.


Installation

Install the module using Composer:

composer require 'drupal/domain_unique_path_alias:^1.0@beta'

Then enable it:

drush en domain_unique_path_alias


Requirements

This module is intended for multi-domain Drupal installations using the
Domain ecosystem.


Supporting organizations: 

Project information

Releases