Nov 05

My .htaccess File is Messing Up awstats on Wordpress Blogs

Tag: Programming & InternetDustin @ 5:04 pm

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

6 Responses to “My .htaccess File is Messing Up awstats on Wordpress Blogs”

  1. jessie says:

    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

  2. Dustin says:

    Well, I prefer to have it in order to get SEO friendly URLs. This is more important that seeing my site stats.

  3. Mats says:

    I tried to do this but I still get a 404-message. Should I just write /awstats/ or /domains/topsecret.com/public_html

  4. Mats says:

    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!

  5. Mats says:

    Well, now it stopped working again. Huh? This is beyond weird.

  6. Jimmy Hennessey says:

    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

Leave a Reply



Clicky Web Analytics