matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.72k stars 2.63k forks source link

Make .htaccess play nicely with OpenLiteSpeed servers #20325

Open atom-box opened 1 year ago

atom-box commented 1 year ago

A user has made his instance integrate well with OpenLiteSpeed by adding three lines to Matomo. They suggest adding these same lines so that all OpenLiteSpeed users can benefit.

Hello, I am using your excellent product on a dedicated server running the http server "openlitespeed". openlitespeed (open source version of litespeed) is able to read .htaccess, just like apache BUT to a certain limit unfortunately.

In fact, I have just noticed that the .htaccess you put in, for example, directories like tmp/ and config/ contain an instruction that openlitespeed does not understand. Quite "basic", it is unfortunately the "deny all" which is not interpreted by openlitespeed.

In order to correct this it is necessary to add this type of block:

<IfModule mod_litespeed.c>
RewriteRule ^(.*)$ - [F,L]
</IfModule>

By adding this inside a <Files "*"> tag it's functional and doesn't interfere with the proper functioning of your product under apache / nginx or whatever. Is it possible to take this into account so that when there is an update to the product, people who are in the same situation as me will find themselves having to rewrite the various .htaccess please? :) This message is in no way a reproach, just a suggestion as you indicate in the comments of these famous .htaccess.

Thank you in advance and thank you again for providing everyone with such a credible alternative to google analytics!

ahabuda commented 1 month ago

Something new? With every major update I have to manually overwrite .htaccess files in several directories. It's a bit of a pain. The above solution would definitely improve the Matomo experience for OpenLiteSpeed ​​server users.