Overview¶
Domain Short URL adds multi-domain awareness to the Short URL module. It enables per-domain slug scoping, domain-aware redirects, and domain-filtered visit tracking.
For bug reports and feature suggestions, visit the issue queue.
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 — visits are tagged with the domain ID so statistics can be filtered per domain
- Per-domain auto-increment counters — each domain maintains its own sequential counter, or a single global counter is shared
- Form integration — the domain selector appears on the short URL node form, filtered by the user's domain access
- Views integration — the admin listing gains a domain filter
Requirements¶
- Drupal 10.2 or 11.x
- Short URL (^1)
- Domain (^3)
- Domain Redirect (^2)
Optional¶
- Domain Access (^3) — filters the domain selector on the node form by the user's assigned domains. Without it, all users with node creation permission see all domains.
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
- Adds a domain filter to the Short URLs admin listing
Uninstalling the module cleanly reverses these changes.
Quick start¶
- Navigate to Administration > Configuration > Domain > Domain Short URL to choose the counter scope.
- Create or edit a Short URL node and select a domain from the dropdown.
- Save — the redirect is created on the selected domain.
- The same slug can now be used on a different domain with a different destination.