Index: piwik.admin.inc
===================================================================
34c34
<     '#description' => t('The URL to your Piwik base directory. Example: "http://www.example.com/piwik/".'),
---
>     '#description' => t('The absolute or relative URL to your Piwik base directory. Example: "http://www.example.com/piwik/" or "piwik/".'),
42c42
<     '#description' => t('The URL to your Piwik base directory with SSL certificate installed. Required if you track a SSL enabled website. Example: "https://www.example.com/piwik/".'),
---
>     '#description' => t('The absolute or relative URL to your Piwik base directory with SSL certificate installed. Required if you track a SSL enabled website. Example: "https://www.example.com/piwik/" or "piwik/".'),
303c303
<   $url = $form_state['values']['piwik_url_http'] .'piwik.php';
---
>   $url = _piwik_get_tracker_url($form_state['values']['piwik_url_http'], TRUE) . 'piwik.php';
310c310
<     $url = $form_state['values']['piwik_url_https'] .'piwik.php';
---
>     $url = _piwik_get_tracker_url($form_state['values']['piwik_url_https'], TRUE) . 'piwik.php';
Index: piwik.module
===================================================================
58,59c58,59
<     $url_http = variable_get('piwik_url_http', '');
<     $url_https = variable_get('piwik_url_https', '');
---
>     $url_http = _piwik_get_tracker_url(variable_get('piwik_url_http', ''));
>     $url_https = _piwik_get_tracker_url(variable_get('piwik_url_https', ''));
494a495,514
> 
> /**
>  * Convert the tracker URLs to a full path, either relative or absolute.
>  *
>  * @param $url
>  *   The URL you want to convert to another format.
>  * @param $absolute
>  *   Whether you want the absolute URL returned to check piwik response.
>  * @return string
>  *   The URL converted into a useful format for inclusion in the page.
>  */
> function _piwik_get_tracker_url($url, $absolute = FALSE) {
>   global $base_url;
>   $prefix = '';
>   if (strpos($url, '://') === false) {
>     $prefix = $absolute ? $base_url . '/' : base_path();
>   }
>   return $prefix . $url;
> }
> 
