Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Separating Piwik's backend and tracking URL

I am using a copy of Piwik, which is excellent.

For paranoia additional security, I want to place Piwik's back-end in a folder that is protected by Apache basic authentication, and whose path is hidden from prying eyes.

 http://example.com/protected/piwik
                        ^----------------- .htpasswd protected

however, now the tracking code of course no longer works!

var pkBaseURL = (("https:" == document.location.protocol) ?
"https://example.com/protected/piwik/" : "example.com/protected/piwik/");

Is there a common way of placing the Piwik back-end in a separate protected directory, but allowing the tracker to work as usual?

like image 400
Pekka Avatar asked Jun 20 '11 14:06

Pekka


1 Answers

There is a better solution: use .htaccess to selectively restrict access to Piwik files: http://forum.piwik.org/read.php?2,17251

like image 194
NickT Avatar answered Sep 20 '22 19:09

NickT