My .htaccess File is Messing Up awstats on Wordpress Blogs
I use DirectAdmin for my hosting control panel. There is a nice plugin to add awstats, but I’ve found they don’t work on sites where I have WordPress set up (such as this site) because I’m using permalinks. No worries though. I found a way to fix it. Just put the bolded line below in your .htaccess:
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/awstats.*$ [NC] [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
*Note: Replace “awstats” with the name of your stats location
Related posts:
- Windows Live Writer Wordpress Fix So when I first tried Windows Live Writer, it seemed...
- Webfaction Review I was looking at my web stats and noticed I...
Related posts brought to you by Yet Another Related Posts Plugin.
November 5, 2007
Posted in: Programming & Internet




12 Responses
xhenxhe, i came across your community post at bumpzee… well, as to this post, why not use an online .htaccess generator or try deleting the .htaccess file… i don’t have a .htaccess file and still everything works… ur right about saying the .htaccess file messes up with some domain-related issues. other experts even recommend that it be deleted so i did for my site
Well, I prefer to have it in order to get SEO friendly URLs. This is more important that seeing my site stats.
I tried to do this but I still get a 404-message. Should I just write /awstats/ or /domains/topsecret.com/public_html
Well, it worked when I wrote it under;
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
That’s a bit weird. But I’m happy as long as it doesn’t hurt me in the long run.
Thank a lot!
Well, now it stopped working again. Huh? This is beyond weird.
I had no choice. I had to give up on wordpress. I use Godaddy for my hosting. If you don’t run Linux, the hosting is not at all script friendly. I know I should change the hosting or the OS but I’m like an stubborn old man, change is scary! Actually, I’m almost 38, the word “like” doesn’t apply anymore…..:-o
Well I don’t know if you’ve done much changing in the last year, but I have to agree with the having to change hosts. I changed from them because they simply couldn’t support what I wanted to do. Plus, things not working, only adds to you being scared of change. I just got my first wordpress blog up a few days ago, but it installed without issue, even on a free host. GoDaddy just ain’t no good.
Plus there are really good plugins nowadays that are free. I haven’t got any issues with GoDaddy as far as webhosting though, and its also quite cheap.
my_world » .htaccess konflikt mellan Wordpress och AWStats - June 21, 2009
[...] bloggen Nerdy Dork erbjuder Dustin Davis en lösning på denna problem. Man lägger till följande kod i .htaccess [...]
Thanks Dustin,
that small change made my url’s seo friendly even though wp #1 seo script but this small touches/changes made it more great..
thanks again m8
@Jimmy – I can highly recommend Hostgator. I have a couple of Wordpress blogs hosted with them and I’ve never had a problem.
@Dustin, sorry to hijack your post to give Jimmy some help
. Thanks for the awstats fix – I’ve tried a number of other ideas that were recommended on the forums but this is the only one that works – top man.
Just a heads up I have found that AwStats is really inaccurate for tracking website visits, as it will log many bots as unique visitors. Some better and easier alternatives are statcounter and google analytics…
Dave
Comments are closed for this entry.