Plone throws 404 not found when using awstats

Plone: 5.0.8
Server: Debian 8.10‬
Server admin: Plesk Onyx 17.8.11
Note: mydomain is redacted.

I run a Plone site with a URL like this:

I created an Apache RewriteRule so that users whould see the friendly URL:

If I want to see my web statistics for that domain it wants to show the following URL: which returns a 404

Also, when I try this URL: it returns a 404.

Has anybody here some experience with configuring awstats and Plone?

In /var/www/vhosts/system/ I see this Alias:

Alias "/plesk-stat" "/var/www/vhosts/system/"
<Location  /plesk-stat/>
        Options +Indexes
<Location  /plesk-stat/logs/>
        Require valid-user
Alias /webstat /var/www/vhosts/system/
Alias /webstat-ssl /var/www/vhosts/system/
Alias /ftpstat /var/www/vhosts/system/
Alias /anon_ftpstat /var/www/vhosts/system/
Alias /awstats-icon /usr/share/awstats/icon

I suspect that the Aliases and the RewriteRule don't go well together:

RewriteRule ^/(.*){HTTP_HOST}:443/Plone/VirtualHostRoot/$1 [P,L]

Any ideas?

I think that would be and, not

These too throw a 404.
Sub-domains (without Plone content) do show statistics with plesk-stat/webstat. These URLs are generated by Plesk and that works as long as you don't rewrite the URL as is needed with a Plone site.

Right; rewriterules are handled first.

Add a few RewriteCond to exclude the aliases and you should be fine.

yes, ask for help in the right forums:

this is not a Plone issue.

I've posted the issue at Awstats sourceforge page:

Well, I couldn't solve this issue but I've found a workaround.

I created a sub-domain and in the "Apache & nginx Settings" (in Plesk) of that sub-domain I added "Alias /webstat-ssl /var/www/vhosts/system/".

So, now I can watch the statistics from my Plone site on that sub-domain.