Title: Problem with HTTPS in proxy mode
Last modified: August 20, 2016

---

# Problem with HTTPS in proxy mode

 *  Resolved [trick77](https://wordpress.org/support/users/trick77/)
 * (@trick77)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/problem-with-https-in-proxy-mode/)
 * Fantastic plugin André, really appreciate it!
 * On my https site I had to comment one line in applyJSCodeChanges:
 *     ```
       function applyJSCodeChanges($strCode) {
               // Change code if js/index.php should be used
               if (self::$aryGlobalSettings['track_mode'] == 1) {
                   $strCode = str_replace('piwik.js', 'js/', $strCode);
                   $strCode = str_replace('piwik.php', 'js/', $strCode);
               } elseif (self::$aryGlobalSettings['track_mode'] == 2) {
                   $strCode = str_replace('piwik.js', 'piwik.php', $strCode);
                   $strURL = str_replace('https://', '://', self::$aryGlobalSettings['piwik_url']);
                   $strURL = str_replace('http://', '://', self::$aryGlobalSettings['piwik_url']);
                   $strProxy = str_replace('https://', '://', plugins_url('wp-piwik'));
                   //$strProxy = str_replace('http://', '://', plugins_url('wp-piwik')); <----
                   $strCode = str_replace($strURL, $strProxy, $strCode);
               }
       ```
   
 * I don’t think you can call str_replace on $strProxy twice in a row that way, 
   you probably need an if there.
 * Cheers
 * [http://wordpress.org/extend/plugins/wp-piwik/](http://wordpress.org/extend/plugins/wp-piwik/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [braekling](https://wordpress.org/support/users/braekling/)
 * (@braekling)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/problem-with-https-in-proxy-mode/#post-3611740)
 * Thanks for your post.
 * Can you try this change, please?
 *     ```
       $strURL = str_replace('https://', '://', self::$aryGlobalSettings['piwik_url']);
       $strURL = str_replace('http://', '://', $strURL);
       $strProxy = str_replace('https://', '://', plugins_url('wp-piwik'));
       $strProxy = str_replace('http://', '://', $strProxy);
       ```
   
 * If this works fine, I’ll provide an update soon.
 *  Thread Starter [trick77](https://wordpress.org/support/users/trick77/)
 * (@trick77)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/problem-with-https-in-proxy-mode/#post-3611746)
 * Working fine, thanks.
 *  Plugin Author [braekling](https://wordpress.org/support/users/braekling/)
 * (@braekling)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/problem-with-https-in-proxy-mode/#post-3611749)
 * Great, I’ll create a fix. It will be released with 0.9.9.2.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Problem with HTTPS in proxy mode’ is closed to new replies.

 * ![](https://ps.w.org/wp-piwik/assets/icon-256x256.png?rev=3529668)
 * [Connect Matomo - Analytics Dashboard for WordPress](https://wordpress.org/plugins/wp-piwik/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-piwik/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-piwik/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-piwik/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-piwik/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-piwik/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [braekling](https://wordpress.org/support/users/braekling/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/problem-with-https-in-proxy-mode/#post-3611749)
 * Status: resolved