Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

LocalGov Microsites Domain Alias

Security covered Under active development

Part of the Localgov ecosystem · 82 projects

This module automatically creates accessible domain aliases for each microsite in any environment, ensuring sites are reachable locally, in staging, and on production from creation. It allows content to be built and verified before the official domain is pointed, and maintains consistent aliases across different environments after database refreshes.

One microsite, reachable in every environment

LocalGov Microsites: Domain Alias automatically creates one Domain Alias per configured environment for every microsite domain on a LocalGov Microsites platform. Each microsite becomes reachable under a predictable hostname in every environment — local, stage, production — from the moment it is created, long before its real domain is pointed at the platform.

For a microsite www.my-site.se on a platform whose controller domain is controller.example.com:

  • www-my-site-se.stage.controller.example.com — stage (no configuration needed)
  • www-my-site-se.sites.example.com — production behind a base domain of your choice
  • www-my-site-se.myproject.lndo.site — local development with Lando

The production alias doubles as a go-live tool: build and verify content on
production — optionally behind basic auth at the ingress — and simply repoint
the real domain when the site is ready.

Why this module exists

On a LocalGov Microsites platform, the domain is the microsite: the site, its admin UI and every editor link resolve through the hostname on the microsite's domain record. That makes the hostname a hard dependency, and in real projects it is rarely ready when you need it.

Microsite owners shouldn't have to wait for DNS. A microsite is usually created long before its real domain (say www.my-site.se) points at the platform — DNS, certificates and hostname config often sit with a third party and take days or weeks. This module generates a temporary alias on a domain the platform already controls the moment the microsite is created, so administrators get a reachable site from day one and can start building content immediately. The real domain is added later, with nothing else to change.

One microsite, every environment. Domain records live in the database, so a copy of production carries production hostnames everywhere else. Instead of hand-editing domains or maintaining local overrides after every database refresh, this module keeps one alias per configured environment alongside the production domain — pull production down to stage, preprod or Lando/DDEV and every microsite is immediately reachable under a predictable hostname.

Features

  • Fully managed aliases — created when a microsite domain is created, replaced when its hostname changes (whichever form or code performs
    the save), removed when the microsite is deleted.
  • Environment configuration UI — add any number of
    environments with an optional base domain or a full {slug}
    pattern; saving regenerates every microsite immediately. Generated DNS
    instructions show exactly which wildcard records to create.
  • Local development aware — pick Lando, DDEV or a custom
    pattern; local aliases are namespaced by the tool's project name
    (LANDO_APP_NAME / DDEV_PROJECT) so a single wildcard
    entry in your tool's config serves every microsite.
  • Editor visibility — the aliases appear as clickable links
    on each microsite's Domain settings tab, and a views field adds an
    "Environments" dropbutton to the microsites overview.
  • Operations support — drush lmda:regenerate
    for bulk regeneration, status report entries that warn about a missing
    default domain or microsites lacking aliases, and a route-cache decorator
    that keeps per-domain front pages from bleeding between domains.

Requirements

Infrastructure. This module creates the Domain Alias records inside Drupal — it does not make the hostnames resolve. For each configured environment you also need:

  • DNS pointing at the environment, normally a wildcard record (*.microsites.example.com). The module generates the exact records to create.
  • A web server / hosting platform that accepts those hostnames — a wildcard virtual host, or the domains registered with your host if it requires that (Platform.sh, Acquia, Pantheon and similar).
  • A TLS certificate covering them, typically a wildcard certificate.
  • If your settings.php sets trusted_host_patterns, a pattern that matches the generated aliases.

Post-installation

Configure environments at Configuration → Domains → Microsite domain
aliases
(/admin/config/domain/microsite-alias). On platforms
where microsites are created at runtime, protect the domain and alias config
entities from drush config:import — for example with
Config Ignore; see
the README for the recommended patterns and first-import ordering.

Credits

Developed by Digitalist for
LocalGov Drupal microsites platforms.

Drupal 11 · not 10 PHP >=8.3

Ask your assistant about LocalGov Microsites Domain Alias

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Sep 2026
Latest release
2 days ago
Releases (12 mo)
4 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
1.0.0 Stable 11 PHP >=8.3 Oct 29, 2026
1.0.0-alpha2 Pre-release 11 PHP >=8.3 Sep 22, 2026
1.0.x-dev Dev 11 PHP >=8.3 Sep 16, 2026
1.0.0-alpha1 Pre-release 11 PHP >=8.3 Sep 16, 2026