Support Center

How do I do enable Trusted Host Settings in Drupal 8?

Last Updated: Jun 09, 2016 08:36PM EEST
The message you receive will usually be along the following lines
Trusted Host Settings    Not enabled
The trusted_host_patterns setting is not configured in settings.php. This can lead to security vulnerabilities. It is highly recommended that you configure this. See Protecting against HTTP HOST Header attacks for more information.

Drupal 8 supports “trusted host patterns”, where you can specify a set of regular expressions, which the domains on incoming requests must match. 

Example configuration in the settings.php file would read:
 
$settings['trusted_host_patterns'] = array(
'^www\.example\.com$',
);​

Read more on Protecting against HTTP HOST Header attacks (prevent your site from thinking it is someone else), at Drupal.org.

Contact Us

[email protected]
http://assets2.desk.com/
false
morethanthemes
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete