Installing Matomo in instead of sub domain

i have a domain where i want to use matomo… my provider still charges me for SSL certificates so i want to install Matomo under instead of

Actually it is a bit more complex because i installed Matomo on my webserver under /websites/matomo/ and then i used .htaccess to simulate a directory that is an proxy to the main directory of Matomo (which should be accessable by several domains)

This kind of works but i wonder if this is a nice way…
its not working for the “opt out”-Cookie in my privacy policy because the cookie is set to the path /s instead of just / (EDIT: probably no problem because it only matters to matomo on /s…)

now i wonder how to make everything more stable…



as i see, the does notwork properly with this configuration…

any possibility to use matomo in a directory instead of a subdomain?

Hi, Kitten!

I would like to help you, but cannot do so until I have determined that your problem is similar to the one that I recently overcame with a simple upgrade of my PHP version.

Please provide the following full URL information:

Where is Matomo currently installed?
Where is the website that Matomo tracks currently installed?
To what new location would you like to install Matomo?

In order to help you with your answer: is a domain name is a directory path that includes the domain name


p.s. To the best of my knowledge ( I am not certain about this) a subdomain is little more that a different way to write a director path. In other words, although treated differently and are located in the same place – namely,

Hi Roddy,

test… does not work… always getting a 500 error when posting a reply. Bad error parsing???

here you can find my reply:

matomo is installed under
This is available under the SSL secured URL

But as i dont want to include “third party” scripts from another domain i wanted do just use mod_proxy to simulate a directory under

the website to be tracked is installed under

It has a .htaccess that simulates the directory /s

RewriteRule ^s/(.*)$$1 [P]

I changed the JS snipped to match the /s

but it still seems that there are some problems… like mentioned above.


Off-Topic, but I could reproduce it. I think the fact that there is an URL to an invlid TLD trips discourse.
Maybe try using .example or for placeholder URLs.

OK. Putting aside your simulated directory for the moment it is now clear that your Matomo and web- applications lie in the same directory path – namely, /websites. Thus communication with the Matomo application using PHP should not be a problem. Now, please allow me to ask what version of PHP you are using?


i think the mistake is that i proxy the request over http…

RewriteRule ^s/(.*)$$1 [P]

All i wanted is to have matomo in one directory on my server for several projects - and not to buy another ssl-certificate… but i think this does not work…

Have you consulted with your Host Server? Mine is very helpful in this regard.



Maybe I am misunderstanding your use case, but what do you need any kind of RewriteRules for?

Shouldn’t it be enough to drop it into a matomo-folder, setting it up and just using https://yourdomain.example/matomo/ as an Matomo URL?

This shouldn’t need any kind of setup and as long as you don’t have anything in your root .htaccess that contradicts anything Matomo needs, everything should work.

i have given up with this thing…

it is really strange.
i now installed matomo under domain.example/matomo…
in order to not show the name “matomo” in the tracking script i put a redirect in my .htaccess like this:

RewriteRule ^s/(.*)$ matomo/$1 [NC,L,QSA]

but i get loads of js errors in the browser console.

after renaming the directory to /s (and removing the mod_rewrite command) it did not work (JS errors)

i endet up with this weird thing:

RewriteRule ^s/(.*)$ s/$1 [NC,L,QSA]

it redirects vom s/ to s/…

dont know what is happening… but without this line of code in the .htaccess it does not work…

How is it that you want to use Matomo, anyway? If you are only reporting to yourself, then surely you can restrict its use to your own IP address and make it invisible to everyone else.


hi roddy,

its not a matter of hiding matomo to other people…

i want to hide the name matomo / piwik from the tracking JS url to prevent adblocker from blocking my tracking script…

but i still wanted the directory to be named “matomo” on my FTP because i still want to have logical names of the directorys in my projects…

it endet up with this weird mod_rewrite command that makes no sense to me…


I’m afraid that won’t help that much as if the visitors are using the EasyPrivacy the GET-parameters used by Matomo are blocked.