Part of the Domain ecosystem · 53 projects
This module allows administrators to control which domains specific routes are accessible on. You can configure which domains are allowed for a given route, preventing users from accessing certain pages on unwanted domains.
The Domain Route Access UI module provides a new configuration entity to manage access to existing routes by domain from back office.
Use case example:
You have two domains example1.com and example2.com and you want users to be able to create their accounts only on the example2.com domain. With Domain Route Access, you can achieve this by adding an access check on the user.register route so that it is only accessible on example2.com.
Configuration
To add new Domain Route Access check:
Option 1: Via Domain Route Access config entity
- Go to Domain Route Access config entity collection page:
/admin/config/domain/route-access - Click Add new Domain Route Access action link
- Fill in the new Domain Route Access config entity form and click Save
- Clear Drupal cache
For each Domain Route Access configuration entity, you could:
- Select the route for which you want to check access by domains
- Select the allowed domains on which the route should be accessible
- Enable/Disable the Domain Route Access check
Option 2: Using existing _domain route requirement
my_module.custom_route:
path: '/foo/bar'
defaults:
_controller: 'Drupal\my_module\Controller\BarsController'
requirements:
_permission: 'view bars content'
_domain: 'domain1_id+domain2_id'Additional Requirements
Domain Route Access requires Domain contrib module.
Ask your assistant about Domain Route Access (UI)
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.
More in the Domain ecosystem
Most installed first