Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By norendahlb on
I'm trying to enable the trusted host settings, but I cannot write a proper regex. I have a standard forwarding where http://mydomain.com is forwarded to http://xx.xxx.xx.xx/soa/index.php.
The only pattern that works is one that allows everything:
$settings['trusted_host_patterns'] = array(
'^.*$',
);
Anything else I attempt results in
The provided host name is not valid for this server.
Example:
$settings['trusted_host_patterns'] = array(
'^www\.mydomain\.com$',
'^http\:\/\/mydomain\.com$',
'^http\:\/\/xx\.xxx\.xx\.xx\/soa\/index\.php$',
);