|
Subject
|
Cannot access stats because of WordPress
|
| | Posted by | bunz (DH New User
) | | Posted on | 11/27/06 10:13 AM |
|
|
Hi all, I'd like help with using the Analog stats (provided by DH) when I am using WordPress. I have already followed these instructions:
http://wiki.dreamhost.com/index.php/Making_stats_accessible_with_htaccess
And they didn't help. My site still thinks I am trying to access a WP page called "stats" which I am not.
Help would be great, thanks!
PS: I also have domain.com AND www.domain.com redirecting to journal.domain.com if that helps you.
|
|
|
|
Subject
|
Re: Cannot access stats because of WordPress
[re: bunz]
|
| | Posted by | seiler (DH DreamNinja) | | Posted on | 11/27/06 10:59 AM |
|
|
If your .htaccess file looks like this:
In reply to:
# BEGIN WordPress RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php # END WordPress
And you make it look like this:
In reply to:
# BEGIN WordPress 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 # END WordPress
That will work. Note that the bold lines have to be added right where they are. If you add them after the WP stuff, it won't work.
--------------------------------------------------------
Save up to $96 at Dreamhost with ALMOST97 promo code (I get $1). Or save $97 with THEFULL97.
|
|
|
|
Subject
|
Re: Cannot access stats because of WordPress
[re: seiler]
|
| | Posted by | bunz (DH New User
) | | Posted on | 11/27/06 11:04 AM |
|
|
Hmm, I just tried that, and it's still thinking I want a blog page called stats. Here's the relevant part of my .htaccess:
# 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 [L] </IfModule> # END WordPress Any further ideas? I wouldn't mind creating a WP page called "stats" and having it redirect somewhere, but http://journal.domain.com/stats/main.html doesn't work either, so I'm not sure what to do.
I do notice an errant [L] in the version I have, so I tried taking it out - no change.
|
|
|
|
Subject
|
Re: Cannot access stats because of WordPress
[re: bunz]
|
| | Posted by | rlparker (DH Pooh-Bah) | | Posted on | 11/27/06 12:12 PM |
|
|
There are only two things I can think of as possibilities:
1) Have you refreshed? Make sure you clear your browser's cache. I have found that on occasion in *spite* of clearing my cache, I have had to close my browser, and re-start it to cleanly get the "new" page.
2) Are you sure you put the .htaccess file in the correct directory? It should go in the "base" directory of your wordpress installation.
Other than that, what you have done looks like it is correct, and has worked for me everytime - in a *lot* of WordPress installations.
--rlparker
|
|
|
|
Subject
|
Re: Cannot access stats because of WordPress
[re: rlparker]
|
| | Posted by | bunz (DH New User
) | | Posted on | 11/27/06 12:16 PM |
|
|
Hah! I just opened up IE (rather than clearing my Firefox cache or closing it) and I was able to get to my stats this time. So evidently it's a cache issue. I'm good now, thanks!
|
|
|
|
Subject
|
Re: Cannot access stats because of WordPress
[re: bunz]
|
| | Posted by | rlparker (DH Pooh-Bah) | | Posted on | 11/27/06 12:24 PM |
|
|
Good Deal! I first noticed the caching issue with the installation of Firefox 2 (which I use almost exclusively), and *that* was where I found I actually had to clear the cache and close the browser in order to *completely* clear the cache. I'm glad you got it sorted.
--rlparker
|
|
|
|
Subject
|
Re: Cannot access stats because of WordPress
[re: rlparker]
|
| | Posted by | bunz (DH Dreamling) | | Posted on | 12/04/06 05:49 PM |
|
|
Hmm, apparently WP reset my .htaccess or something. I had to re-insert those lines. It was fine after that, but I wonder if there's a way to make it permanent, so WP won't mess with it?
|
|
|
|
Subject
|
Re: Cannot access stats because of WordPress
[re: Etoile]
|
| | Posted by | rlparker (DH Pooh-Bah) | | Posted on | 12/04/06 05:54 PM |
|
|
In reply to:
apparently WP reset my .htaccess or something... I wonder if there's a way to make it permanent, so WP won't mess with it?
I have not dug into the WP code thoroughly enough to know exactly how it works, but indications seem to be that when WP needs to modify .htaccess, it just "rewrites" it using the "new" rewrite rules, rather than doing any kind of "smart" append or anything.
Things like changing your permalink structure (which rewrites the "rewrite" rules) and, of course, updates to WP seem to be the principle times this happens, though there may be other situations that I have not encountered. 
That said, what I have done is just keep my "original/working" WP .htaccess available so that I can easily "merge" it with the "new" version if WP rewrites it. I have not really considered it a problem as it happens infrequently.
--rlparker
|
|
|
|
Subject
|
Re: Cannot access stats because of WordPress
[re: bunz]
|
| | Posted by | seiler (DH DreamNinja) | | Posted on | 12/04/06 11:33 PM |
|
|
Did you change any settings in WP, or do anything that could have triggered it?
I'm not sure what you could change to keep WP from touching it, so I'd just add it for now and see how it goes.
If you change or add anything, you should check it right after you do, just to see if you can narrow it down to when it happens.
--------------------------------------------------------
Save up to $96 at Dreamhost with ALMOST97 promo code (I get $1). Or save $97 with THEFULL97.
|
|
|
|
Subject
|
Re: Cannot access stats because of WordPress
[re: bunz]
|
| | Posted by | rlparker (DH Pooh-Bah) | | Posted on | 12/05/06 01:18 AM |
|
|
In reply to:
apparently WP reset my .htaccess or something... I wonder if there's a way to make it permanent, so WP won't mess with it?
I have not dug into the WP code thoroughly enough to know exactly how it works, but indications seem to be that when WP needs to modify .htaccess, it just "rewrites" it using the "new" rewrite rules, rather than doing any kind of "smart" append or anything.
Things like changing your permalink structure (which rewrites the "rewrite" rules) and, of course, updates to WP seem to be the principle times this happens, though there may be other situations that I have not encountered.
That said, what I have done is just keep my "original/working" WP .htaccess available so that I can easily "merge" it with the "new" version if WP rewrites it. I have not really considered it a problem as it happens infrequently.
--rlparker
(Weird - I originally posted this, in this thread, hours ago at 1754 PST, but in response to another user's (or sock puppet's) post. that is no longer here. I can get to this post's "original". but it doesn't show up anywhere in the "threaded view" though it *does* show up in the "flat" view and in searches (but not the individual Forum summary screens . If this is a "repeat" for you, I apologize - I just wanted the OP to see the answer so I "re-posted"
|
|
|
|
Subject
|
Re: Cannot access stats because of WordPress
[re: bunz]
|
| | Posted by | hobbes (DH New User
) | | Posted on | 12/05/06 03:55 AM |
|
|
I think if you separate out your own rewrite rules from the WP rules, WP will leave yours alone. ie:
# Your own rules <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^/directoryname1/(.*)$ [OR] RewriteCond %{REQUEST_URI} ^/directoryname2/(.*)$ [OR] RewriteCond %{REQUEST_URI} ^/failed_auth.html$ RewriteRule ^.*$ - [L] </IfModule> # End of your own rules
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
|
|
|
|
Subject
|
Re: Cannot access stats because of WordPress
[re: hobbes]
|
| | Posted by | rlparker (DH Pooh-Bah) | | Posted on | 12/05/06 04:20 AM |
|
|
In reply to:
I think if you separate out your own rewrite rules from the WP rules, WP will leave yours alone.
That's a great tip! Have you tested it to see if it works that way in WordPress? If so, that is definitely a "keeper" (and probably a good candidate for wiki inclusion) 
--rlparker
|
|
|
|
Subject
|
Re: Cannot access stats because of WordPress
[re: rlparker]
|
| | Posted by | hobbes (DH New User
) | | Posted on | 12/05/06 05:13 AM |
|
|
Well, I can't say I've tested it properly, but it hasn't broken so far. When I was researching this, I came across this page:
http://codex.wordpress.org/Using_Permalinks
in which they say "WordPress will play nice with an existing .htaccess and will not delete your existing rules".
I'm guessing this is only true if you add rules outside of the the WP rule entries (ie before the BEGIN Wordpress comments). I'm also guessing that WP has the right to add and delete anything within the "BEGIN" and "END wordpress" rules.
Edited by hobbes on 12/05/06 05:14 AM (server time).
|
|
|
|
Subject
|
Re: Cannot access stats because of WordPress
[re: hobbes]
|
| | Posted by | rlparker (DH Pooh-Bah) | | Posted on | 12/05/06 05:15 AM |
|
|
Good Deal! I definitely think the WP codex is "authoritative". Thanks for pointing that out; I'm sure it will be helpful to a lot of us.
--rlparker
|
|
|