Getting 403's when you enable permalinks?
Add this to the top of your .htaccess file
Options +SymLinksIfOwnerMatch
Making stats accessible with htaccess
From DreamHost
Many CMS and blog tools install a .htaccess file that makes our stats unreachable, including our Wordpress 2.0 (
http://wordpress.org/) one-click install and the Drupal (
http://drupal.org/) and Textpattern (
http://textpattern.com/) CMS systems. For these examples we will use a Wordpress .htaccess file. (Drupal instructions.)
This problem does not apply to a Wordpress blog installed in a sub directory of your server. (For example, a blog at domain.com/ will be affected, but a blog at domain.com/blog/ will not be.)
Code:
# 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 before the section added by Wordpress:
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/failed_auth.html$
RewriteRule ^.*$ - [L]
</IfModule>
Those lines are self contained, so you can put them at the beginning of any .htaccess file to fix stats, they won't interfere with other .htaccess operations.
The final .htaccess file for Wordpress would look like:
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/failed_auth.html$
RewriteRule ^.*$ - [L]
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php
</IfModule>
# END WordPress
The repeated lines won't cause any problems, and are necesary because Wordpress 2.0 has taken to doing whatever it pleases to the stuff within the Wordpress section.
The same basic idea works for Textpattern. Here's a sample .htaccess for Textpattern.
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
# Dreamhost stats
RewriteBase /
RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/failed_auth.html$
RewriteRule ^.*$ - [L]
# Textpattern
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteRule ^(.*) index.php
</IfModule>