How do I configure my server to let Matomo serve HTML files?
For Matomo (Piwik) to work correctly, your web browser should be able to download from your Matomo server a set of HTML files. This FAQ explains what are various ways to configure your server to deliver Matomo HTML files.
To test whether your server can serve HTML, visit this URL: demo.matomo.cloud/plugins/MultiSites/angularjs/dashboard/dashboard.directive.html (replace demo.matomo.cloud with your Matomo URL). If this HTML page on your server looks the same as this page then your server is configured properly to serve HTML files!
If the test does not succeed then you need to enable your server to correctly serve HTML files for Matomo:
- if you are using Apache as webserver, put
AddHandler text/html .html
in the<directory>
section of the Apache host config. Restart the webserver. - if you are using Nginx, check out the Piwik-Nginx configuration. Note: make sure you replace the corresponding line in the piwik-nginx configuration with your own domain(s):
valid_referers none blocked *.mysite.com othersite.com;
(if that is too much of a hassle for you then just comment out thevalid_referers
block.) - if you are using the module Pagespeed in your server, please note that (pagespeed extension does not work with Matomo). You may disable pagespeed for Matomo by adding this to the apache config:
ModPagespeedDisallow "path_to_piwik_here"
- if you still have issues serving HTML files, verify that your server does not redirect requests from
index.php
toindex
or fromindex.php
to/
. Such redirects may cause loss of POST variables causing issues. - if you still have issues serving HTML files, try to recursively change permission on the path/to/piwik/plugins folder (
chmod -R 755 plugins/
)
If you have other suggestions to add to this list, please use the form in this page.
Note: if you get the error message client denied by server configuration
then you are experiencing this issue. You may follow the list of suggestions above to get it resolved.