Server host www.domain.com not allowed!

After upgrading from OJS 3.3.0.8 to OJS 3.3.0.10 everything passed well. But, now loading the website can be only with https://domain.com/ not via https://www.domain.com/. After loading with the old web address https://www.domain.com/ the webpage received 400 Bad Request and in error log file Server host "www.domain.com not allowed!
Where can I change allow hosts or from which links is it possible to access the site? How do I add that the domain is loaded with www, http, https …?
The most of links which are worked is our of function.
PHP is 7.4

Kind regards,
Lazar

Did you configure the allowed_hosts variable in config.inc.php ? For an example, see in config.TEMPLATE.inc.php. You can specify multiple domains in array.

1 Like

Hi @mpbraendle,

thank you for your fast response and answer. This is exactly what I try to find. In row allowed_hosts = ’ ’ I added all domains that I plan to use and now works very well.

Kind regards,
Lazar

1 Like

Hi! @Lazar_Stosic
Could you show how you added the sites (an example) in the line allow_hosts = ’ ’
I have tried various ways but it seems like I am missing something or making some mistake somewhere.
Thanks!

Hi @David_Alarcon_davidy

it is so simple. In config.inc.php under allowed_hosts insert all variants of your domain. For example, below is an example where domain.com need to be changed with your domain.
allowed_hosts = "["domain.com", "https://www.domain.com", "www.domain.com"

If you still have problem write me your domain and I will back you with full line which you need just to enter.

Regards,
Lazar

1 Like

@Lazar_Stosic
thank you very much for your answer… now everything works correctly!

1 Like