My site stopped suddenly, with an error message
The provided host name is not valid for this server.
And even though I removed
$settings['trusted_host_patterns']
Completely from the settings file and cleared the cache via Drush
drush cache-rebuild
also, i tried use this settings:
$settings['trusted_host_patterns'] = [ '.*' ]; and $settings['trusted_host_patterns'] = [];
but, the site still shows the same error, and i cant access Drupal log or anywhere to detected the problem cause.
Apache settings are also fine, like mentioned in one of the previous experiments here
What are the causes of this error and how can it be fixed?
note:
The site was previously working with trusted_host_patterns settings.
my domain name has dash (-), so i used this pattern:
$settings['trusted_host_patterns'] = ['^[domain/-/name]\.com$', '^www\.[domain/-/name]\.com$', '^www\.[domain\-name]\.com$', '[domain\-name]\.com$', ];
two week ago, but it stopped working suddenly today, and I removed trusted_host_patterns setting, but it not resolved.
Note: I checked adding $settings['trusted_host_patterns'] = [ '.*' ];
and $settings['trusted_host_patterns'] = [];
either, both don't work.