This module allows you to use separate hostnames for your website's public visitors and its administrators, while still running on a single Drupal installation. It can route administrative tasks to a secure backend domain while keeping the public-facing site accessible on a different domain. This is useful for enhancing security by restricting network access to the admin area and for providing a cleaner URL structure.
Split Admin Domain lets one Drupal site use two hostnames: one for visitors and one for administration.
Editors and administrators use a backend domain (for example, admin.example.com), while the public site remains on the frontend domain (for example, www.example.com). Drupal still runs as a single installation with one codebase and database. The module controls which hostname serves administrative and public URLs.
Typical reasons to use it:
- Restrict the admin hostname using a VPN or firewall while keeping the public site accessible.
- Keep
/adminand other editing routes off the public domain. - Open links that switch between the frontend and backend domains in a new tab.
The module does not replace Drupal authentication, roles, permissions, or HTTPS. It helps separate the public and administrative interfaces, but additional access controls are needed to protect the backend.
Features
Basic functionality
- Redirect
/adminand/admin/*to the backend domain. - Redirect non-admin paths on the backend domain to the frontend.
- Treat the backend homepage (
/) as the admin interface when path stripping is enabled. - Generate links with the appropriate hostname for menus, toolbar links, and forms.
- Open links that switch between domains in a new tab (
target="_blank").
Additional features
- Additional admin paths: Configure patterns such as
/node/*/editand/media/addto serve common editing routes on the backend domain. - Optional
/adminpath stripping: Convert URLs such as/admin/configto/configon the backend, while avoiding conflicts with existing document root directories such as/modulesand/themes. - Scheme and port handling: Preserve the visitor's scheme and port when generating cross-domain redirects to avoid breaking HTTP and HTTPS session handling.
- Shared sessions: Support sessions across subdomains when both hosts share a parent domain, using
cookie_domaininservices.yml.
When to use it
- You want a dedicated admin subdomain that can be restricted at the network level.
- You want to keep administrative routes off the public hostname.
- You have a traditional Drupal site and need a straightforward frontend/backend domain split rather than a full multi-domain content system.
Post-Installation
- Configure both hostnames to point to the same Drupal document root and database.
- Add both hostnames to
$settings['trusted_host_patterns']insettings.php. - Enable the module and navigate to Administration → Configuration → System → Split Admin Domain (
/admin/config/system/split-admin-domain). - Configure the following settings:
- Frontend domain: The public site URL.
- Backend domain: The administration URL.
- Strip /admin from backend paths: Optional.
- Additional admin paths: One pattern per line, with defaults covering common editing routes.
- To share sessions across subdomains, configure a common cookie domain in
services.yml, then log out and log in again.
parameters:
session.storage.options:
cookie_domain: '.example.com'
If the hostnames do not share a parent domain, browsers cannot share the session cookie. Users will need to authenticate separately on each domain.
The module does not introduce new content types or text formats. Its configuration consists of the settings form, along with the necessary server, DNS, trusted host, and optional cookie domain configuration.
Additional Requirements
- Drupal 11.1 or 12 (depends on Drupal core's
systemmodule). - Two hostnames pointing to the same Drupal installation.
- Both hostnames configured in
$settings['trusted_host_patterns']. - For shared sessions, a common parent domain and a
cookie_domainsetting inservices.yml.
No additional contributed modules, PHP libraries, or external APIs are required.
Recommended modules and tools
- Admin Toolbar — provides faster navigation through Drupal's administration interface.
- A WAF, VPN, or firewall for the backend hostname — helps restrict access to the administrative interface.
Similar projects
- Admin Domain — separates administration and public domains using domain assignment and access permissions. Split Admin Domain focuses on a frontend/backend pair, configurable admin path patterns, optional
/adminstripping, and scheme and port handling. - Domain — supports multi-domain content, access, and configuration. It is better suited to sites that need domain-aware content management rather than just a separate administrative hostname.
Additional notes
- When path stripping is enabled, the module avoids rewriting paths such as
/admin/modulesand/admin/themesto/modulesand/themes, which could conflict with directories in the document root. - This module does not replace authentication, HTTPS, or network-level access restrictions. Combine it with these controls to protect the backend.
Ask your assistant about Split admin domain
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
- system Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.