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 jjgw on
I installed Drupal 8.0.0.0 on Ubuntu 14.04
In the Status Report I got next message : "Trusted Host Settings Not enabled"
According to instructions I found, I added next code into settings.php :
@code
$settings['trusted_host_patterns'] = array(
'^localhost$',
);
@endcode
But the report warning message remains.
What can I do?
Comments
=-=
The setting in question is not related to installation. Please edit the opening post and move it to the 'post installation' forum.Thank you.Did u try
Did u try to log off/in and restart (Apache) server (or maybe clearing cache also) ?
From my experiences, some new settings don't work if I don't those mentioned actions.
Maybe, it'll help you also.
stop/restart apache2 does not
stop/restart apache2 does not help and caching is not enabled.
So there must be another reason.
And what about to try this
And what about to try this trick to try out:
https://drupal.stackexchange.com/questions/145690/untrusted-host-localho...
It's working now after
It's working now after inserting in settings.php :
$settings['trusted_host_patterns'] = array(
'^localhost$',
);
without @code/@endcode tags as I did before (I'am newbe with php!)
Thanks for helping me.
It's not working for me
I tried that and it doesn't work for me. I work with acquia (local development) but i don't know if that's a problem. I always get the following message: "The provided host name is not valid for this server."
I don't know what else i can do :(
Trusted hosts and acquia dev desktop locally
Hi,
I'm working with Acquia dev desktop locally (on windows) and found the Acquia adds its own domain name locally with - sitename:dd
sitename being the name you called your site when creating it. So the code in the settings.php file would be -
$settings['trusted_host_patterns'] = array(
'^sitename.dd$',
);
This worked for me. You may need to stop and start Apache.
Trusted hosts and acquia dev desktop locally
Thank you very much!!!! Finally it worked!
Trusted Host Settings Not enabled
$settings['trusted_host_patterns'] = array(
'^sitename.dd$',
);
Worked for me too!
Thank!
But still incorrect ...
the pattern should escape the meaning of . to take it literally!
should be
'^sitename\.dd$',
You want running restricted to sitename.dd and not allow sitenameadd ... sitenamezdd
Same issue - with XAMPP
error when trying to install core and external modules
$settings['trusted_host_patterns'] = array(
'^localhost$',
'^192\.168\.0\.22$',
'^127\.0\.0\.1$',
);
Have stopped and started XAMPP and cleared the cache - no change.
This is ridiculous! =(
This is working for me :
This is working for me :
$settings['trusted_host_patterns'] = array(
'^localhost$',
'^192\.168\.53\.222$',
'^127\.0\.0\.1$',
);
Thanks
work fine
I move the code out of the comment block (comment block start with /** , end with */)
trusted_host_patterns
Thanks it's work for me.
I move the code end of the settings.php file, it work's fine,it might suitable for all drupal versions because so much of comment blocks (comment block start with /**, end with */) are there in the settings.php file.
Put the settings
Put the settings configuration
$settings['trusted_host_patterns'] = array(
'^localhost$',
'^localhost\.*',
);
before
/**
* Trusted host configuration. then it will work