Overview
Site statistics are not available on DreamPress plans.
Many CMS and blog applications generate their own .htaccess file that makes DreamHost stats unreachable. To correct this situation, you need to edit your .htaccess file.
This problem does not apply to a WordPress blog installed in a subdirectory on your server. For example, a blog at example.com/ will be affected, but a blog at example.com/blog/ will not be.
Editing an .htaccess file
An .htaccess file is a plain text file. As such, there are many different ways to edit the file. The easiest way is to edit the file using an FTP client. In that client, make sure the ability to view hidden files is enabled. This allows you to see files beginning with a period which you can then edit and save by using your client.
A better way to edit an .htaccess file is to connect to your server via SSH and open the file up in a text editor. A good choice is a text editor called nano. You can then simply make your changes and re-save it.
View the following article for details on how to edit a file via SSH:
Other text editors
Long term, you may want to find a text editor you can use to edit files on your own computer that gives you an option to save with 'Unix-style' line endings. This enables you to use FTP to copy the .htaccess file to your computer, edit it with familiar tools, and then place it back onto the server (again via FTP).
For the Macintosh, Bare Bones BBEdit (or the free Textwrangler) is regarded as the best text editor to use:
For Windows-based PCs, a popular text editor that many use is Notepad++:
Good text editors are available for just about any platform. Many are "free" and/or open source and can be easily located via a Google search.
What to change in the .htaccess file
Once you've opened the file in nano (or another text editor), you'll need to update it using the information below.
Your "standard" WordPress .htaccess file looks something like this:
# 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 RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
To allow the /stats directory to be displayed properly on DreamHost, you need to add the following lines to your .htaccess before the section added by WordPress:
ErrorDocument 401 "Error" ErrorDocument 403 "Error" <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^/(stats|failed_auth\.html).*$ [NC] RewriteRule . - [L] </IfModule>
- The lines used in the above example are self contained, so you can put them at the beginning of any .htaccess file to fix stats and won't interfere with other .htaccess operations.
- The above entries work with Drupal as well (added above your standard Drupal .htaccess file code).
The final .htaccess file for WordPress would look like:
ErrorDocument 401 "Error" ErrorDocument 403 "Error" <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^/(stats|failed_auth\.html).*$ [NC] RewriteRule . - [L] </IfModule>
# 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 RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
If this doesn't seem to initially work for you, remember to clear your cache. Visit the following article for further details:
To get your stats working in Ruby on Rails or Joomla, add the following to the top of the .htaccess file (located in the /public directory of your Rails app or root directory of your Joomla web site):
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^/(stats|failed_auth\.html).*$ [NC] RewriteRule . - [L] </IfModule>