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:

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

$settings['trusted_host_patterns'] = array(

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
    Commented Apr 1, 2016 at 9:55
  • That works! I thought I would have to put the exact path.
    – Martin K
    Commented Apr 1, 2016 at 9:58

1 Answer 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):


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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