The provided host name is not valid for this server.
ドキュメント通り設定したのに…
https://www.drupal.org/docs/8/install/trusted-host-settings
こちらにある通り、config.phpを書き換えましたが、どうもみてくれないようでした。
ゴリ押し
drupal-8.5.5/core/lib/Drupal/Core/DrupalKernel.php
protected function initializeSettings(Request $request) {
$site_path = static::findSitePath($request);
$this->setSitePath($site_path);
$class_loader_class = get_class($this->classLoader);
Settings::initialize($this->root, $site_path, $this->classLoader);
// Initialize our list of trusted HTTP Host headers to protect against
// header attacks.
$host_patterns = Settings::get('trusted_host_patterns', []);
# ホワイトリスト追加 START
$host_patterns[] = '^www\.example\.com$';
$host_patterns[] = '^example\.com$';
# ホワイトリスト追加 END
if (PHP_SAPI !== 'cli' && !empty($host_patterns)) {
if (static::setupTrustedHosts($request, $host_patterns) === FALSE) {
throw new BadRequestHttpException('The provided host name is not valid for this server.');
}
}
下記の部分です
DrupalKernel.php
# ホワイトリスト追加 START
$host_patterns[] = '^www\.example\.com$';
$host_patterns[] = '^example\.com$';
# ホワイトリスト追加 END
Drupal8詳しい人いたら教えてください…
ググっても答えが見つかりませんでした。config.phpを読まないという。