Wordpress and /stats on a domain

Discussion in 'WordPress' started by Catnabbit, Jun 2, 2006.

  1. #1
    I use wordpress on the front page of my website, so Wordpress keeps changing my .htaccess to take over my site, and do a 404 when I try to access /stats which should lead me to the statistics area that Dreamhost provides.

    I keep changing it back, but Wordpress keeps reverting my changes after I save them.

    Does anyone have any idea how I can make Wordpress stop 404'ing my stats page?

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    # These are the standard WordPress Rules
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    Code (markup):
    That's the standard wordpress .htaccess rules.

    I know that I can add this to it:

    RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]
    RewriteCond %{REQUEST_URI} ^/failed_auth.html$
    RewriteRule ^.*$ - [L]
    
    Code (markup):
    This works for a day or so, and I can access my /stats without a 404, but then Wordpress changes back to the original .htaccess and my new rules disappear. Adding this snippet of code before or after the #begin/end wordpress segments either does not work, or breaks the whole site.

    Does anyone know how I can make my added code stick?
     
    Catnabbit, Jun 2, 2006 IP
  2. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #2
    I don't know the answer but I may have to learn it soon.

    Have you looked in the Dreamhost wiki?

    I have found several helpful answers there.
     
    Colbyt, Jun 2, 2006 IP
  3. Catnabbit

    Catnabbit Peon

    Messages:
    91
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Dreamhost support is where I got the idea to add the above snippet of code, but I haven't found a solution that will stay permanent yet.

    If you find anything let me know!
     
    Catnabbit, Jun 2, 2006 IP
  4. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #4

    My blog in the dreamhost account has not been up long enough to have stats. When I tried to view them I got dumped to the parent directory of the site. I did not get a 404.

    Will follow this up in a day or two when the stats have cycled.

    Do you just have the one site? And could you view the stats before the install of WP?
     
    Colbyt, Jun 2, 2006 IP
  5. Catnabbit

    Catnabbit Peon

    Messages:
    91
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    The problem is that if you have WP installed on the root of the domain (not a subdirectory), WP will overwrite the .htaccess for the site, demanding that requests for /stats will go to index.php and WP will not yield /stats to dreamhost. The workaround I already have makes it so that wordpress will turn it over to dreamhost, but Wordpress keeps reverting the change, taking back /stats for itself.

    So, yes i could see stats before install of WP.. it's a known problem on all sites that have Wordpress on the root of their domain and use /stats for their statistics. Wordpress really wants to keep /stats for itself. It's not a problem specifically with dreamhost. It's a problem with Wordpress and the .htaccess file.
     
    Catnabbit, Jun 2, 2006 IP
  6. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #6

    I am unable to duplicate your problem. I have WP 2.02 installed in the root directory of the domain and the stats are displaying just fine. I used the auto installer at DH to install the script.

    Permalinks are set to the default selection.

    I have heard of problems when that setting is changed but I don't recall it dealing with stats.

    The site has only been up a few days. If I develope a problem I will certainly post a correction to this post and a solution if I find one.
     
    Colbyt, Jun 3, 2006 IP
  7. Catnabbit

    Catnabbit Peon

    Messages:
    91
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Can you paste what your .htaccess says in between the #begin and #end wordpress sections?

    As I said in the original post, the /stats will work for a day or so after I "fix" the .htaccess and then Wordpress will revert. So give it some time.

    I've got wordpress installed on the root of about 6 sites and they are all doing this
     
    Catnabbit, Jun 3, 2006 IP
  8. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #8

    I don't have any .htaccess files on any of my hosted domains at DH. To verify that I had not restricted their view somehow I used the same ftp program to vist a couple of other domains I own. They showed up just fine.

    I did a little reading in the help files. I was actually trying to figure out what replaces "file manager" in their control panel. I did find a reference to an OS commerce problem that could be resolved.....anyhow... SE friendly titles was the goal.

    Do you have your sites configured to run php as cgi? That solved the OS-com problem. It is the way all of mine are set up and with that solution php does not run as an Apache module so I guess .htaccess is not required.

    It can be changed after the fact in the control panel. You might need to manually delete the .htaccess file after doing so. If you aren't willing to chance it with an existing blog you could try it with a different domain.

    I am going to give it a week to see if my stats disappear. If they don't and you haven't tested this I guess I will test this myself since I am now curious.

    For the benifit of others we both should follow up in this thread with whatever we discover.
     
    Colbyt, Jun 4, 2006 IP
  9. -Abhishek-

    -Abhishek- Regaining my Momentum!

    Messages:
    2,109
    Likes Received:
    302
    Best Answers:
    0
    Trophy Points:
    0
    #9
    -Abhishek-, Jun 4, 2006 IP
  10. Catnabbit

    Catnabbit Peon

    Messages:
    91
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Abhishek - I tried making my .htaccess not writable but for some reason that didn't stick either.

    Colbyt - Wordpress will not work without a .htaccess file. You must have one. If you are logged in through shell just go to your domain's root directory and do "cat .htaccess" without the quotes and that will tell you what the contents are. Further you can go into Wordpress and click Manage - Files and .htaccess will be listed there.
     
    Catnabbit, Jun 4, 2006 IP
  11. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #11

    One picture = 1000 words.

    [​IMG]


    Ready to try run as cgi now?

    I am a newbie with WP but I made darn sure I was right before I posted the earlier reply.
     
    Colbyt, Jun 4, 2006 IP
  12. Catnabbit

    Catnabbit Peon

    Messages:
    91
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #12
    I was mistaken, wordpress might work without .htaccess but I have permalinks turned on since this is more search engine friendly. If you have permalinks turned off I guess it might work without the .htaccess.
     
    Catnabbit, Jun 12, 2006 IP