ISPConfig stats does not working with wordpress

Discussion in 'General' started by pecka33, Nov 2, 2025 at 10:52 AM.

  1. pecka33

    pecka33 Member

    Hello,
    i have a problem. I enabled awstats in ISPConfig, but i can not access to mydomain.com/stats/
    I am using wordpress and in my htaccess file I have this but when i remove htaccess file or delete content in htaccess mydomain.com/stats/ start working and i can log in and see all stats. Any idea please?
    Code:
    # BEGIN LSCACHE
    # END LSCACHE
    # BEGIN NON_LSCACHE
    # END NON_LSCACHE
    
    # BEGIN WordPress
    # The directives (lines) between "BEGIN WordPress" and "END WordPress" are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    
     
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I think you just need to exclude /stats/ (and possibly /awstats-icon/) from being rewritten by WordPress.

    Try editing your .htaccess and add these lines above the RewriteCond %{REQUEST_FILENAME} !-f line:
    Code:
    # Allow AWStats to be accessed directly
    RewriteCond %{REQUEST_URI} ^/stats/ [NC]
    RewriteRule ^ - [L]
    
    # (Optional) Allow AWStats icons to be loaded properly
    RewriteCond %{REQUEST_URI} ^/awstats-icon/ [NC]
    RewriteRule ^ - [L]
    
    These two rules kinda tell Apache to stop rewriting if the request is for /stats/ or /awstats-icon/ and handle them normally, while everything else thereafter are handled by WordPress.

    Don't forget to restart Apache and clear browser cache before retrying.
     
    till likes this.

Share This Page