Multi-domain awareness for the Short URL module. Adds per-domain slug scoping, a domain field on short URL nodes, and domain-aware redirects.

Features

  • Per-domain slug scoping — the same slug (e.g. /blog) can exist on multiple domains, each pointing to a different destination
  • Domain field on short URL nodes — assign each short URL to a specific domain
  • Domain-aware redirects via Domain Redirect — redirects are scoped to the correct domain automatically
  • Domain-aware visit tracking — the shorturl_visits table gains a domain_id column so statistics can be filtered per domain
  • Domain-aware slug generation — auto-increment counters can be scoped per-domain or kept global
  • Form integration — the domain selector appears on the short URL node form, with access control via Domain Access
  • Configuration UI at /admin/config/domain/shorturl for counter scope settings

Requirements

Optional

  • Domain Access (^3) — filters the domain selector on the node form by the user's assigned domains

Architecture

The module uses service decoration to extend the base Short URL services:

  • DomainAwareShortUrlManager decorates ShortUrlManager — injects the domain ID into redirects and visit records
  • DomainAwareSlugGenerator decorates SlugGenerator — adds domain-scoped uniqueness checks and per-domain counters
  • DomainAwareVisitMiddleware replaces the base visit middleware to record the active domain on each visit

Installation

composer require drupal/domain_shorturl
drush en domain_shorturl

The install hook automatically:

  • Adds a domain_id column to the shorturl_visits table
  • Adds the domain field to the short URL form and view displays

Uninstalling the module cleanly reverses these changes.

Supporting organizations: 
Development

Project information

Releases