@oparoz opened this Issue on October 1st 2010

Instead of having the nice hierarchical breakdown by folders, most of my entry/exit pages start with a slash (/) and are followed by the full URL
/http://mysite.com/folder

I have no idea why only a few work properly, but it could be related to another bug I filed where URLs in my piwik are encoded.

@oparoz commented on October 1st 2010

The encoding related ticket is #1746

@oparoz commented on October 1st 2010

I found out why all those URLs are wrong!

Only SSL URLs are properly displayed. The ones containing only http are preceded by a slash and shown in full.

It seems Piwik doesn't work properly when using secure URLs.

@robocoder commented on October 1st 2010 Contributor

I re-read your comment and there's a contradiction in your last two sentences.

@oparoz commented on October 1st 2010

I apologize, the last sentence should read:
"It seems Piwik doesn't work properly when accessing the interface via a secure URL".

But I think I've found the problem and it has to do with the way it was installed.
There is an .htaccess in a folder above which does an automatic SSL redirection.

@robocoder commented on October 1st 2010 Contributor

What does the rewrite rule look like? Maybe we can detect this case and avoid double encoding.

@oparoz commented on October 1st 2010

That would be great :)

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

@oparoz commented on October 1st 2010
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
@robocoder commented on October 1st 2010 Contributor

I don't have access to my test box at the moment, but can you try using the 'NE' (noescape) or 'B' (escape backreference) flags? Something like:

RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [NE,R,L]

or:

RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [B,R,L]
@oparoz commented on October 1st 2010

I've tried "NE", but it didn't work properly.

URLs looked good, but there was no information about the referer.

@robocoder commented on October 1st 2010 Contributor

Is that conclusion based others visiting your site? (For your visits, you have to observe the 3rd case in http://piwik.org/faq/troubleshooting/#faq_51.)

@oparoz commented on October 1st 2010

I've visited a few sites that I track.
I've closed sessions.
As soon as the htaccess was gone, I could see the Google keywords.

With the .htaccess, the connexion made was always using SSL.

One way to avoid these kind of issues could be to have the management interface in a separate folder like /admin.

Another way would be for Piwik to be able to force an SSL connection to the management interface.

@robocoder commented on October 1st 2010 Contributor

Forcing the UI to use ssl is covered by #1677.

IIRC, you can put the rewrite rule within a <Files>...</Files> container. In this way, you could make sure the redirect isn't applied to piwik.php.

@oparoz commented on October 1st 2010

Thank you very much for the quick answers.
I should have thought of <Files>...</Files> :S

This Issue was closed on October 1st 2010
Powered by GitHub Issue Mirror