Title: HTAccess Rule problem
Last modified: August 18, 2016

---

# HTAccess Rule problem

 *  Resolved [stonegauge](https://wordpress.org/support/users/stonegauge/)
 * (@stonegauge)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/htaccess-rule-problem/)
 * I installed 2.0 to a two websites that are live on the net — [http://www.zimmermann2006.com](http://www.zimmermann2006.com)
   and [http://www.sticksoffire.com](http://www.sticksoffire.com) (just for reference).
   I had to contact my hosting’s support people because, for soem reason unknown
   to me, stats that are posted on my hosts server (the host is Dreamhsot BTW) weren’t
   showing up for some reason and redirecting me to the main pages of said websites.
 * Support got back to me and noted that HTAccess (default install of HTaccess at
   that) was posting lines that were preventing the stats link from working::
 *  RewriteEngine On
    RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond%{
   REQUEST_FILENAME} !-d RewriteRule . /index.php
 * Now, seeing my HTAccess files (which I hadn’t viewed until talking with support)
   contain not much more than this, is it going to break something if I remove these
   trouble lines from my HTAccess files on said sites listed above?

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/htaccess-rule-problem/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/htaccess-rule-problem/page/2/?output_format=md)

 *  Thread Starter [stonegauge](https://wordpress.org/support/users/stonegauge/)
 * (@stonegauge)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/htaccess-rule-problem/#post-322570)
 * Yeah, that cauxses a problem all right — now I can’t get to any of the site pages….
   blah. (this problem was fixed by just re-approving permalink structure — butttt
   the domain I am trying to access for server stats becomes unavalible again)
 *  Thread Starter [stonegauge](https://wordpress.org/support/users/stonegauge/)
 * (@stonegauge)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/htaccess-rule-problem/#post-322759)
 * This isn’t resolved in Full but there was a fix presented to me by Dreamhost 
   tech support. It can be found here:
 * [http://wiki.dreamhost.com/index.php/Making_stats_accessible_with_htaccess](http://wiki.dreamhost.com/index.php/Making_stats_accessible_with_htaccess)
 *  [infinitewarrior](https://wordpress.org/support/users/infinitewarrior/)
 * (@infinitewarrior)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/htaccess-rule-problem/#post-322895)
 * Unfortunately, that doesn’t work with 2.0. Removing that rewrite rule will actually
   get you to the directory. (You’ll get the password prompt if it’s protected.)
   It still doesn’t show you stats, though, just a 404.
 * WP doesn’t appear to write anything to .htaccess anymore. So, what might have
   changed in 2.0 that would affect this…?
 *  [infinitewarrior](https://wordpress.org/support/users/infinitewarrior/)
 * (@infinitewarrior)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/htaccess-rule-problem/#post-322934)
 * Resolved? What’s the answer? 🙂
 * Correction: Nothing seems to be *different* .htaccess-wise between 1.5 and 2.0.
   Just suddenly stopped working on upgrade. :\
 *  Thread Starter [stonegauge](https://wordpress.org/support/users/stonegauge/)
 * (@stonegauge)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/htaccess-rule-problem/#post-322937)
 * It was resolved as there is a resolution presented on Dreamhost’s wiki….
 * Many CMS and blog tools install a .htaccess file that makes our stats unreachable,
   including our WordPress 2.0 one-click install. They usually look something like:
 * # BEGIN WordPress
    <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond%{
   REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.
   php </IfModule> # END WordPress
 * To fix this you need to add the following lines to your .htaccess immediately
   after the the RewriteBase line
 * RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]
    RewriteCond %{REQUEST_URI} ^/failed_auth.
   html$ RewriteRule ^.*$ – [L]
 * So the final .htaccess file would look like:
 * # BEGIN WordPress
    <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond%{
   REQUEST_URI} ^/stats/(.*)$ [OR] RewriteCond %{REQUEST_URI} ^/failed_auth.html
   $ RewriteRule ^.*$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}!-
   d RewriteRule . /index.php </IfModule> # END WordPress
 *  Thread Starter [stonegauge](https://wordpress.org/support/users/stonegauge/)
 * (@stonegauge)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/htaccess-rule-problem/#post-322960)
 * OK this is NOT resolved.
 * For soem reason, every time I upload an edited .htaccess file, it works for a
   little bit and then stops working and reverts back to the original HTaccess file…
 *  [snidog](https://wordpress.org/support/users/snidog/)
 * (@snidog)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/htaccess-rule-problem/#post-323000)
 * Thanks for pointing out that fix, stonegauge. It worked perfectly for me.
 *  [roshangupta](https://wordpress.org/support/users/roshangupta/)
 * (@roshangupta)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/htaccess-rule-problem/#post-323006)
 * This plugin should take care of it.
 * <?php
    /* Plugin Name: Dreamhost Stats Plugin URI: [http://atastandstill.com](http://atastandstill.com)
   Description: Prevents WordPress from intercepting the Dreamhost stats page by
   modifying the .htaccess file. Author: Roshan Gupta Version: 1.0 Author URI: [http://atastandstill.com/](http://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’);
 * ?>
 *  Thread Starter [stonegauge](https://wordpress.org/support/users/stonegauge/)
 * (@stonegauge)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/htaccess-rule-problem/#post-323010)
 * Rosh, where should that code be inserted?
 * Thanks
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/htaccess-rule-problem/#post-323011)
 * If I were to guess, I’d put it in a new file named something like “DreamhostStats.
   php” and then drop it into my plugins directory to see if it flies.
 *  Thread Starter [stonegauge](https://wordpress.org/support/users/stonegauge/)
 * (@stonegauge)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/htaccess-rule-problem/#post-323013)
 * OK, still issues with the plugin. Saved the code (as suggested above) as dreamhoststats.
   php and uploaded to my plugins directory.
 * When I click ACTIVATE, I get this error message:
 * Warning: Cannot modify header information – headers already sent by (output started
   at /home/.kafka/rtfldgr/boltsmag.com/wp-content/plugins/dreamhoststats.php:27)
   in /home/.kafka/rtfldgr/boltsmag.com/wp-admin/plugins.php on line 16
 * Operations seemed normal and yes – I was able to view stats fine again but I 
   heard from a friend who also tried this about there being other call errors appearing
   on the Admin control panel.
 * When you deactivate the plugin, there is a call error that I believe is the same
   as the one i posted above but on line 22 instead of 16.
 *  Thread Starter [stonegauge](https://wordpress.org/support/users/stonegauge/)
 * (@stonegauge)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/htaccess-rule-problem/#post-323015)
 * I’d also like to note the plugin will kill RSS feeds:
 * Warning: Cannot modify header information – headers already sent by (output started
   at /home/.kafka/rtfldgr/boltsmag.com/wp-content/plugins/dreamhoststats.php:27)
   in /home/.kafka/rtfldgr/boltsmag.com/wp-rss.php on line 8
 *  Thread Starter [stonegauge](https://wordpress.org/support/users/stonegauge/)
 * (@stonegauge)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/htaccess-rule-problem/#post-323038)
 * any updates on this plugin code?
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/htaccess-rule-problem/#post-323039)
 * See if you have an empty/blank line in the source of the plugin at either the
   very top or very end. If you do, remove it.
 * [more here](http://codex.wordpress.org/FAQ_Troubleshooting#How_do_I_solve_the_Headers_already_sent_warning_problem.3F)
 *  Thread Starter [stonegauge](https://wordpress.org/support/users/stonegauge/)
 * (@stonegauge)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/htaccess-rule-problem/#post-323040)
 * One single space after the closing tag. Sheesh.
 * That solves the ADMIN errors. Unfortunately after the fix is employed, the plug
   in doesn’t work any more. type in the “domain.ext/stats” in the browser and you
   get sent to the main page of your website instead of dreamhost stats.
 * *sigh*

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/htaccess-rule-problem/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/htaccess-rule-problem/page/2/?output_format=md)

The topic ‘HTAccess Rule problem’ is closed to new replies.

## Tags

 * [conflict](https://wordpress.org/support/topic-tag/conflict/)
 * [default](https://wordpress.org/support/topic-tag/default/)
 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)
 * [redirect](https://wordpress.org/support/topic-tag/redirect/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 16 replies
 * 5 participants
 * Last reply from: [stonegauge](https://wordpress.org/support/users/stonegauge/)
 * Last activity: [20 years, 1 month ago](https://wordpress.org/support/topic/htaccess-rule-problem/page/2/#post-323054)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
