문제

I'm trying to migrate a drupal website from a server into my localhost but I trigger the error

The provided host name is not valid for this server.

I've seen I need to add the trusted host pattern, but looks like this is not working I still get the error

My server is run on port 9000

sudo php -S 127.0.0.1:9000

My trusted hosts, and I've no Vhost

$settings['trusted_host_patterns'] = array(
  '^serverStuffWeDontMind$',
  '^localhost\:9000$',
);
도움이 되었습니까?

해결책

If this is a dev - env, simply add

$settings['trusted_host_patterns'] = [$_SERVER['SERVER_NAME']];

But never do this in production.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 drupal.stackexchange
scroll top