simone960's picture

$settings['trusted_host_patterns'] = array('^www\.example\.com$');

 

I wonder how to configure on the code above in settings.php if I have a domain like example.org.au

and I want to include all the subdomains etc. abc.example.org.au

 

Accepted answer

You would use this instead then:

$settings['trusted_host_patterns'] = array('example\.org\.au$');

I just changed the 'com' to 'org', added 'au', and removed '^www\.' to allow any prefix.

If you're interested in the syntax here, look up 'regular expressions' in your favourite search engine.

Comments

You would use this instead then:

$settings['trusted_host_patterns'] = array('example\.org\.au$');

I just changed the 'com' to 'org', added 'au', and removed '^www\.' to allow any prefix.

If you're interested in the syntax here, look up 'regular expressions' in your favourite search engine.

simone960's picture

Thanks Guru ! Just applied and it works perfectly!