Getting DreamHost stats and WordPress working.

I have a couple of other blogs that run on the popular WordPress blogging engine.  Linux hosting compared to windows hosting is much cheaper by comparison.  My most recent site ViPR blog runs on WordPress hosted by DreamHost.  Up until now Google Analytics has just been enough for me but I wanted to know more about my visitors.

DreamHost offer stats on domains hosted with them and as such append it to the domain.  For example mydomain.com/stats/ but if your running WordPress then accessing it just isn’t possible due to the url rewriting rules that WordPress sets up in the .htaccess file.

I’ve not had much experience hacking about with the .htaccess file up until now.  Like normal I took a backup for the file and then started adding the rule so that WordPress would ignore my stats url.

After playing about with numerous attempts the following seems to be working for me

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

First mistake I made was to put this after the # BEGIN WordPress section, so if you do use this make sure the above is before. 

Reference: http://httpd.apache.org/docs/current/mod/mod_rewrite.html

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Simon Philp

Subscribe now to keep reading and get access to the full archive.

Continue reading