Short URL for Domain
This module enhances the "Short URL" module to work within a multi-domain setup. It allows the same short URL path to exist on different domains, each pointing to a unique destination, and ensures redirects and visit tracking are correctly handled for each specific domain. The module also adds a domain assignment field to short URL nodes for better organization.
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_visitstable gains adomain_idcolumn 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/shorturlfor counter scope settings
Requirements
- Drupal 10.3+ or 11.2+
- Short URL (^2)
- Domain (^3)
- Domain Redirect (^2)
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_idcolumn to theshorturl_visitstable - Adds the domain field to the short URL form and view displays
Uninstalling the module cleanly reverses these changes.
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 1.0.0-beta1 | Pre-release | 10–11 | Jun 9, 2026 | ||
| 1.0.0-alpha2 | Pre-release | 10–11 | Apr 13, 2026 | ||
| 1.0.0-alpha1 | Pre-release | 10–11 | Apr 13, 2026 | ||
| 1.x-dev | Dev | 10–11 | Apr 13, 2026 |