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: mydomain.com:8080/Plone

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

If I want to see my web statistics for that domain it wants to show the following URL: mydomain.com/plesk-stat/webstat/ which returns a 404

Also, when I try this URL: mydomain.com:8080/Plone/plesk-stat/webstat/ it returns a 404.

Has anybody here some experience with configuring awstats and Plone?

In /var/www/vhosts/system/mydomain.com/conf/httpd.conf I see this Alias:

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

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

RewriteRule ^/(.*) http://mydomain.com:8080/VirtualHostBase/https/%{HTTP_HOST}:443/Plone/VirtualHostRoot/$1 [P,L]

Any ideas?

I think that would be domain.com/webstat and domain.com/plesk-stat, not domain.com/plesk-stat/webstat.

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.

Thanks.
I've posted the issue at Awstats sourceforge page: https://sourceforge.net/p/awstats/discussion/43428/thread/85cc4834/

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/mydomain.com/statistics/webstat-ssl".

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