Forum Replies Created

Viewing 1 replies (of 1 total)
  • This plugin should take care of it.

    <?php
    /*
    Plugin Name: Dreamhost Stats
    Plugin URI: https://atastandstill.com
    Description: Prevents WordPress from intercepting the Dreamhost stats page by modifying the .htaccess file.
    Author: Roshan Gupta
    Version: 1.0
    Author URI: https://atastandstill.com/
    */

    function enable_dreamhost_stats($content) {
    if (strpos($content, ‘RewriteBase /’) !== FALSE) {
    $content = str_replace(‘RewriteBase /’,
    ‘RewriteBase /’ . “\n” . ‘RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]’ . “\n” .
    ‘RewriteCond %{REQUEST_URI} ^/failed_auth.html$’ . “\n” . ‘RewriteRule ^.*$ – [L]’, $content);
    }
    else {
    $content = str_replace(‘RewriteEngine On’,
    ‘RewriteEngine On’ . “\n” . ‘RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]’ . “\n” .
    ‘RewriteCond %{REQUEST_URI} ^/failed_auth.html$’ . “\n” . ‘RewriteRule ^.*$ – [L]’, $content);
    }
    return $content;
    }

    add_filter(‘mod_rewrite_rules’, ‘enable_dreamhost_stats’);

    ?>

Viewing 1 replies (of 1 total)