Trusted Hostname

I have an issue I hope somebody can help me with.

I have installed piwik on a subdomain analytics.mydomain.com - my trusted host is analytics.mydomain.com - my emails won’t send.

I change toe trusted hosts to mydomain.com - emails won’t send.

I change toe trusted hosts to www.mydomain.com - emails send BUT I have a yellow error warning box stating the following;


Warning: You are now accessing Piwik from http://www.analytics.mydomain.com/index.php, but Piwik has been configured to run at this address: http://www.mydomain.com/index.php. 
Piwik may be misconfigured (for example, if Piwik was recently moved to a new server or URL). You can either click here and add www.analytics.mydomain.com as the valid Piwik hostname (if you trust it), or 
click here and go to www.mydomain.com to access Piwik safely. 

How do I fix this problem and how do I login again?
The Piwik Super User can manually edit the file piwik/config/config.ini.php and add the following lines:
[General]
trusted_hosts[] = "www.analytics.mydomain.com"
After making the change, you will be able to login again.
You may also disable this security feature (not recommended). To do so edit config/config.ini.php and add:
[General]
enable_trusted_host_check=0

I have followed all the steps above to no avail.

PLEASE help with this one.

Regards,

J

Hi,

I had a similar problem. I solved this adding multiple hostnames like this:


trusted_hosts[] = "subdomain1.domain.tld"
trusted_hosts[] = "subdomain2.domain.tld"

This has allowed me to have several valid domains working with piwik and no warning.

Hope this helps.
Regards

2 Likes