How to allow access to a Drupal file/page only from a specific domain?
I have tried php filter module but enabling this module can cause security and performance issues as it allows users to execute PHP code on your site.
How to allow access to a Drupal file/page only from a specific domain?
I have tried php filter module but enabling this module can cause security and performance issues as it allows users to execute PHP code on your site.
You can add an AccessChecker on your specific route and check if the domain is the correct one.
In your_module.services.yml :
In your_module.routing.yml:
And finaly in your DomainAccessChecker.php: