SSL and "Page URL not defined"

Hello,
since I moved Piwik site to https, in the Visitor log and for every action I get “Page URL not defined” while the page title is correct. If I switch back to http everything is fine.
I found another topic with the same problem ma there was no answer.

Any clue? Thank you.

Could you compare the tracking requests? You can use the browser console to get them. You can also enable tracker debug mode and check the output. See Tracking HTTP API: API Reference - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3

I tried, this is with https enabled and all traffic redirected to https. It seems the problem is where it says WARNING: URL looks invalid and is discarded.

DEBUG Piwik\Common[2016-03-13 17:20:56] [8eb72] array (
DEBUG Piwik\Common[2016-03-13 17:20:56] [8eb72] )
DEBUG Piwik\Common[2016-03-13 17:20:56] [8eb72] Time elapsed: 0.146s
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] Debug enabled - Input parameters:
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] array (
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘action_name’ => ‘Formazione%20Aziendale%20%7C%20Hdemo%20Network’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘idsite’ => ‘4’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘rec’ => ‘1’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘r’ => ‘115234’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘h’ => ‘18’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘m’ => ‘21’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘s’ => ‘38’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘url’ => ‘http%3A%2F%2Fwww.hdemo.com%2Fformazione%2F’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘urlref’ => ‘http%3A%2F%2Fwww.hdemo.com%2Findustria-grafica%2F’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘_id’ => ‘279e644cd4658b37’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘_idts’ => ‘1457889289’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘_idvc’ => ‘1’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘_idn’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘_refts’ => ‘1457889289’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘_viewts’ => ‘1457889289’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘_ref’ => ‘https%3A%2F%2Fwww.google.it%2F’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘send_image’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘pdf’ => ‘1’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘qt’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘realp’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘wma’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘dir’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘fla’ => ‘1’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘java’ => ‘1’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘gears’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘ag’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘cookie’ => ‘1’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] ‘res’ => ‘2560x1600’,
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] )
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] Current datetime: 2016-03-13 17:21:39
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] Executing Piwik\Plugins\CoreHome\Tracker\VisitRequestProcessor::manipulateRequest()…
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] Executing Piwik\Plugins\Actions\Tracker\ActionsRequestProcessor::manipulateRequest()…
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] Executing Piwik\Plugins\Goals\Tracker\GoalsRequestProcessor::manipulateRequest()…
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] Executing Piwik\Plugins\Ecommerce\Tracker\EcommerceRequestProcessor::manipulateRequest()…
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] Executing Piwik\Plugins\SitesManager\Tracker\SitesManagerRequestProcessor::manipulateRequest()…
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] Executing Piwik\Plugins\CustomVariables\Tracker\CustomVariablesRequestProcessor::manipulateRequest()…
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] Executing Piwik\Plugins\Heartbeat\Tracker\PingRequestProcessor::manipulateRequest()…
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] Executing Piwik\Plugins\CoreHome\Tracker\VisitRequestProcessor::processRequestParams()…
DEBUG PrivacyManager[2016-03-13 17:21:39] [fee43] DoNotTrack header not found
DEBUG CoreHome[2016-03-13 17:21:39] [fee43] Matching visitors with: visitorId=279e644cd4658b37 OR configId=5ea946c933b93458
DEBUG CoreHome[2016-03-13 17:21:39] [fee43] The visitor is known (idvisitor = 279e644cd4658b37,
DEBUG CoreHome[2016-03-13 17:21:39] [fee43] config_id = 5ea946c933b93458,
DEBUG CoreHome[2016-03-13 17:21:39] [fee43] idvisit = 28254,
DEBUG CoreHome[2016-03-13 17:21:39] [fee43] last action = Sun, 13 Mar 2016 17:20:56 +0000,
DEBUG CoreHome[2016-03-13 17:21:39] [fee43] first action = Sun, 13 Mar 2016 17:14:48 +0000,
DEBUG CoreHome[2016-03-13 17:21:39] [fee43] visit_goal_buyer’ = 0)
DEBUG Piwik\Common[2016-03-13 17:21:39] [fee43] Executing Piwik\Plugins\Actions\Tracker\ActionsRequestProcessor::processRequestParams()…
DEBUG Actions[2016-03-13 17:21:39] [fee43] (this is not a Site Search request)
DEBUG Actions[2016-03-13 17:21:39] [fee43] WARNING: URL looks invalid and is discarded
DEBUG Actions[2016-03-13 17:21:39] [fee43] Excluding parameters “preview,gclid,fb_xd_fragment,fb_comment_id,phpsessid,jsessionid,sessionid,aspsessionid,doing_wp_cron,pk_cpn,pk_campaign,piwik_campaign,utm_campaign,utm_source,utm_medium,pk_kwd,pk_keyword,piwik_kwd,utm_term” from URL
DEBUG Actions[2016-03-13 17:21:39] [fee43] WARNING: URL looks invalid and is discarded
DEBUG Actions[2016-03-13 17:21:39] [fee43] Before was ""
DEBUG Actions[2016-03-13 17:21:39] [fee43] After is "http%3A%2F%2Fwww.hdemo.com%2Fformazione%2F"
DEBUG Actions[2016-03-13 17:21:39] [fee43] Action is a PAGE_URL,
DEBUG Actions[2016-03-13 17:21:39] [fee43] Action name = Formazione%20Aziendale%20%7C%20Hdemo%20Network,
DEBUG Actions[2016-03-13 17:21:39] [fee43] Action URL =

This is with https enabled but no forced redirection of http to https.
Looking at url, urlref and Action name I see, not an expert at all, that in this case strings are properly decoded while in the previous case they are not. Could this be the reason which leads Piwik to discard such URLs ?

DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] array (
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘action_name’ => ‘Yes, man. No, thanks | Italiandirectory’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘idsite’ => ‘3’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘rec’ => ‘1’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘r’ => ‘774349’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘h’ => ‘18’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘m’ => ‘59’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘s’ => ‘9’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘url’ => ‘Yes, man. No, thanks - Italiandirectory’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘urlref’ => ‘http://italian-directory.it/’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘_id’ => ‘3ef5c5b29b2b749b’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘_idts’ => ‘1432286975’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘_idvc’ => ‘70’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘_idn’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘_refts’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘_viewts’ => ‘1457891302’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘send_image’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘pdf’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘qt’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘realp’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘wma’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘dir’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘fla’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘java’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘gears’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘ag’ => ‘0’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘cookie’ => ‘1’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘res’ => ‘720x1184’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] ‘gt_ms’ => ‘837’,
DEBUG Piwik\Common[2016-03-13 17:59:09] [e6c04] )

Could you paste both requests? These to /piwik.php resource with all GET params.

Here they are.

1- No redirect http to https

REQUEST
GET /piwik.php?action_name=Riflessioni%20su%20tempo%20e%20luce%20per%20l%E2%80%99inaugurazione%20del%20nuovo%20Studio%20Rocci%20%7C%20Italiandirectory&idsite=3&rec=1&r=360394&h=11&m=38&s=47&url=http%3A%2F%2Fitalian-directory.it%2Fstudiorocci-nuovo-studio-recensione-evento&urlref=http%3A%2F%2Fitalian-directory.it%2F&_id=658019dda703f800&_idts=1457951119&_idvc=1&_idn=0&_refts=0&_viewts=1457951119&send_image=0&pdf=1&qt=1&realp=0&wma=1&dir=1&fla=1&java=1&gears=0&ag=1&cookie=1&res=1280x1024&gt_ms=817 HTTP/1.1
Host: piwik.epylabs.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0
Accept: image/png,image/;q=0.8,/*;q=0.5
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
DNT: 1
Referer: Riflessioni su tempo e luce per l’inaugurazione del nuovo Studio Rocci - Italiandirectory
Connection: keep-alive

RESPONSE
HTTP/1.1 204 No Response
Server: nginx
Date: Mon, 14 Mar 2016 10:38:46 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 0
Connection: keep-alive
p3p: CP='OTI DSP COR NID STP UNI OTPa OUR’
Tk: 1
Set-Cookie: _pk_uid=deleted; expires=Sun, 15-Mar-2015 10:38:45 GMT
Host-Header: 192fc2e7e50945beb8231a492d6a8024
Vary: Accept-Encoding
X-Proxy-Cache: MISS

2- Redirect http to https

REQUEST
GET /piwik.php?action_name=Riflessioni%20su%20tempo%20e%20luce%20per%20l%E2%80%99inaugurazione%20del%20nuovo%20Studio%20Rocci%20%7C%20Italiandirectory&idsite=3&rec=1&r=596213&h=11&m=30&s=8&url=http%3A%2F%2Fitalian-directory.it%2Fstudiorocci-nuovo-studio-recensione-evento&urlref=http%3A%2F%2Fitalian-directory.it%2F&_id=658019dda703f800&_idts=1457951119&_idvc=1&_idn=0&_refts=0&_viewts=1457951119&send_image=0&pdf=1&qt=1&realp=0&wma=1&dir=1&fla=1&java=1&gears=0&ag=1&cookie=1&res=1280x1024&gt_ms=679 HTTP/1.1
Host: piwik.epylabs.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0
Accept: image/png,image/;q=0.8,/*;q=0.5
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
DNT: 1
Referer: Riflessioni su tempo e luce per l’inaugurazione del nuovo Studio Rocci - Italiandirectory
Connection: keep-alive

RESPONSE
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Mon, 14 Mar 2016 10:30:07 GMT
Content-Type: text/html; charset=iso-8859-1
Content-Length: 502
Connection: keep-alive
Location: https://piwik.epylabs.com/piwik.php?action_name=Riflessioni%20su%20tempo%20e%20luce%20per%20l%E2%80%99inaugurazione%20del%20nuovo%20Studio%20Rocci%20%7C%20Italiandirectory&idsite=3&rec=1&r=596213&h=11&m=30&s=8&url=http%3A%2F%2Fitalian-directory.it%2Fstudiorocci-nuovo-studio-recensione-evento&urlref=http%3A%2F%2Fitalian-directory.it%2F&_id=658019dda703f800&_idts=1457951119&_idvc=1&_idn=0&_refts=0&_viewts=1457951119&send_image=0&pdf=1&qt=1&realp=0&wma=1&dir=1&fla=1&java=1&gears=0&ag=1&cookie=1&res=1280x1024&gt_ms=679
Vary: Accept-Encoding
Content-Encoding: gzip
X-Proxy-Cache: MISS

Something is wrong with your redirect. The URL parameter in your redirect should be set to:

http%3A%2F%2Fitalian-directory.it%2Fstudiorocci-nuovo-studio-recensione-evento

But currently it’s:
http%253A%252F%252Fitalian-directory.it%252Fstudiorocci-nuovo-studio-recensione-evento

Thank you. The problem is I have no idea what is wrong with my redirection. I have in place this rule in htaccess:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ Sign in - Piwik [R,L]

Do you have any idea why the URL parameter is erroneously redirected? By the way I noticed that the redirected url is the encoded version of the first.

Thank you

Update: my latest remark led me to find the NE flag for the rewrite rule:
RewriteRule ^(.*)$ Sign in - Piwik [R,NE,L]

“By default, special characters, such as & and ?, for example, will be converted to their hexcode
equivalent. Using the [NE] flag prevents that from happening.”

At first test it seems doing the trick. What do you think?

This makes sense. Hope it works now. :wink:

Thank you for your support.
First of all, now it is working but…

1- a rewrite rule is the most common way (and suggested) to channel all traffic to https.
2- as far as I know, mod rewrite url encode query strings before redirection by default
3- you can leave encoding out with the NE flag but, is this always good?

Would not be better if piwik tracker had a flag to disable query string encoding so that mod rewrite could get it right?
Just an idea. Thank you.