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
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.
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.
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!
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.
You need to add all version, with http, https, and without that in host allowed. Just one domain is not enough. Write me what you added in that line. In previous posts you can find an example.