Split admin domain
Split Admin Domain lets one Drupal site use two hostnames: one for visitors, one for administration.
Editors and admins work on a backend domain (for example admin.example.com). The public site stays on the frontend domain (for example www.example.com). Drupal still runs as a single codebase and database—this module only controls where admin vs public URLs are served.
Typical reasons to use it:
- Put the admin hostname behind a VPN or firewall while leaving the public site open
- Keep
/admin(and other edit URLs) off the public domain - Open cross-domain links in a new tab so editors can jump between public and admin without losing context
It does not replace Drupal login, roles, HTTPS, or permissions. It is an access-boundary helper on top of normal Drupal security.
Features
Basic functionality
- Force
/adminand/admin/*onto the backend domain - Redirect non-admin paths on the backend domain back to the frontend
- Treat the backend homepage (
/) as the admin UI when path stripping is enabled - Rewrite generated links so menus, toolbar, and forms point at the correct domain
- Open links that switch domain in a new tab (
target="_blank")
Unique / useful extras
- Configurable extra admin paths (patterns such as
/node/*/edit,/media/add) so common editor routes also live on the backend - Optional strip of
/adminon the backend (for example/admin/config→/config), while never stripping paths that would collide with real docroot directories (/modules,/themes, …) - Scheme and port follow the visitor so HTTP/
SESSand HTTPS/SSESSsessions are not broken by cross-scheme redirects - Shared session support when both hosts share a parent domain (via
cookie_domaininservices.yml)
When to use it
- You want a dedicated admin subdomain you can restrict at the network layer
- You want a cleaner public hostname with no admin UI routes
- You run a traditional (coupled) Drupal site and need a simple front/admin host split—not a full multi-domain content system
Post-Installation
- Point both hostnames at the same Drupal docroot and database.
- Add both hosts to
$settings['trusted_host_patterns']insettings.php. - Enable the module and go to Administration → Configuration → System → Split Admin Domain (
/admin/config/system/split-admin-domain). - Set:
- Frontend domain (public site URL)
- Backend domain (admin URL)
- Optionally Strip /admin from backend paths
- Additional admin paths (one pattern per line; defaults cover common edit routes)
- For single sign-on across subdomains, set a shared cookie domain in
services.yml, then log out and log in again:
parameters:
session.storage.options:
cookie_domain: '.example.com'
If the two hosts do not share a parent domain, browsers cannot share the session cookie—users must log in on each host.
There is no new content type or text format. Configuration is only the settings form above (plus server/DNS/trusted_host_patterns/cookie domain).
Additional Requirements
- Drupal 11.1 or 12 (depends on core
systemonly) - Two hostnames resolving to the same Drupal installation
- Both hostnames in
$settings['trusted_host_patterns'] - For shared login: a common parent domain and
cookie_domaininservices.yml
No extra contributed modules, PHP libraries, or external APIs are required.
Recommended modules/libraries
- Admin Toolbar — faster navigation once admins are on the backend domain
- A WAF / VPN / firewall on the backend hostname — the usual pairing for this pattern
Similar projects
- Admin Domain — also splits management vs public domains with route/domain assignment and an access permission. Split Admin Domain focuses on a simple frontend/backend pair, configurable admin path patterns, optional
/adminstripping, and session-safe scheme/port handling. - Domain — multi-domain content, access, and configuration across many sites. Much broader than a front/admin host split; use Domain when you need domain-aware content affinity, not only an admin hostname.
Supporting this Module
Add Patreon / Open Collective / GitLab sponsor links here if you have them, or remove this section.
Community Documentation
- Module README in the Git repository (installation, cookie domain, behavior table)
- Add DrupalPod demo, screencast, or handbook links when available
Additional notes
- Enabling path stripping never rewrites
/admin/modules,/admin/themes, and similar paths into bare/modulesor/themes, because those collide with directories in the web root. - This module is not a substitute for authentication, HTTPS, or locking down the backend at the network layer—combine it with those controls for a real admin access boundary.
Depends on
Dependencies of the latest stable release
- system Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 1.0.0 | Stable | 11 | Sep 30, 2026 |