1

I'm working with a test site installed on a server on my network. Since it's only a sandbox, it has no domain name. Drupal being installed in a sub-directory (there are several sandboxes), I access it through an address like this: http://10.156.222.145/d8

However, when I put this in the trusted host patterns, like so:

$settings['trusted_host_patterns'] = array(
    '^10\.156\.222\.145\/d8$',
    '^localhost$'
  );

I get the error message: "The provided host name is not valid for this server."

Question: is it even possible to configure these settings with an IP address, and if so how?

  • 1
    Host names don't contain the path - have you tried '^10\.156\.222\.145$'? – Clive Apr 1 '16 at 9:55
  • That works! I thought I would have to put the exact path. – Martin K Apr 1 '16 at 9:58
1

Yes using an IP is fine, you just need to make sure you're using a valid host name (I.e. one without the path appended):

^10\.156\.222\.145$
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.