0

So I am trying to get this drupal(drupal845.localhost) site accessible by my VM. But the Trusted Host Settings are not working.

Here are the settings in my settings.php

$settings['trusted_host_patterns'] = array(
   '^drupal845\.localhost$'
   '^.+\.drupal845\.localhost$'
   '^192\.*\.*\.*\.drupal845\.localhost$',
);

Not working

I have another drupal(drupal.localhost) site on the same machine and the trusted host patterns work. This is what I have in my settings.php for trusted host patterns:

$settings['trusted_host_patterns'] = array(
   '^drupal\.localhost$'
   '^.+\.drupal\.localhost$'
   '^192\.*\.*\.*\.drupal\.localhost$',
);

Working

Why does it work on the drupal.localhost but not on drupal845.localhost

Also to note is I have .localhost masked to 127.0.0.1. I have to specify the port because windows is using 80 so my WSL(Ubuntu) Apache server I set to use 8080. They both work without the ip specification as well.

0

So I figured out what was wrong. I didn't have my apache site config set correctly. I had:

snip...    
<VirtualHost *:8080>
           ServerAdmin webmaster@localhost
           ServerName drupal845.localhost
           ServerAlias www.drupal845.localhost
           end snip...

What I needed:

snip...    
<VirtualHost *:8080>
           ServerAdmin webmaster@localhost
           ServerName drupal845.localhost
           ServerAlias www.drupal845.localhost *.drupal845.localhost
           end snip...

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.