Get The Dreamhost Stats Page Working on a WordPress Site

For websites hosted with Dreamhost, you have an analytics page by default at yoursite.tld/stats/. WordPress can interfere with this, thinking that you are trying to link to a page or category and give you a generated 404 page instead.

Simply add this to your .htaccess file ABOVE the typical # BEGIN WordPress stuff to get it working again.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/(stats|failed_auth\.html).*$ [NC]
RewriteRule . - [L]


  1. User Avatar
    Permalink to comment#

    Just the code i was looking for and to add to this, it wont appear to be working unless you clear your cookies or whatever and then reload it. the codes perfect just it wont seem to work unless you do :)

  2. User Avatar
    Permalink to comment#

    Thanks!!! That’s exactly what I needed, the pages really did look ugly with the ?p=number!!

    Keep up the good work!

  3. User Avatar
    Permalink to comment#

    Thanks. Its exactly what i am looking for!

  4. User Avatar
    Sharon Hiebing
    Permalink to comment#

    Wow, thank you for this! Dreamhost could not help me with this at all!! I did what you said, and right away it worked. And Candace, thanks for mentioning clearing the cookies – I had the same problem and after I did that, worked right away!!

    Sharon Hiebing
    Follow Your Dream Compass

  5. User Avatar
    Barry Kafka
    Permalink to comment#

    Thanks, great tip. I rebuilt my permalinks a few times in the WP dashboard to get my nav working again. (Settings > Permalinks > Save Changes)

  6. User Avatar
    Permalink to comment#

    Excellent post! Now my stats pages are working again.

  7. User Avatar
    Permalink to comment#

    I’ve been using this for a while to view the stats page but I’ve been having problems with our forum running in the subdirectory “forums”–WordPress was messing with that as well, throwing 404 errors every half-dozen accesses or so. I duplicated this chunk in the .htaccess file and changed “stats” to “forums” and it appears to be working. I’m hoping this wasn’t a bad idea (for performance or somesuch).

Leave a Comment

Posting Code!

You may write comments in Markdown. This makes code easy to post, as you can write inline code like `<div>this</div>` or multiline blocks of code in triple backtick fences (```) with double new lines before and after.

Code of Conduct

Absolutely anyone is welcome to submit a comment here. But not all comments will be posted. Think of it like writing a letter to the editor. All submitted comments will be read, but not all published. Published comments will be on-topic, helpful, and further the discussion or debate.

Want to tell us something privately?

Feel free to use our contact form. That's a great place to let us know about typos or anything off-topic.