Differences between revisions 1 and 2
Revision 1 as of 2007-08-27 22:00:45
Size: 2360
Editor: rrcs-24-172-164-205
Comment: hope this flies
Revision 2 as of 2009-09-20 22:13:21
Size: 2370
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 14: Line 14:
[http://drupal.org/ Drupal Home] [[http://drupal.org/|Drupal Home]]
Line 26: Line 26:
[http://www.mamboserver.com/ Mambo Home] [[http://www.mamboserver.com/|Mambo Home]]
Line 37: Line 37:
[http://wordpress.org/ WordPress Home] [[http://wordpress.org/|WordPress Home]]
Line 50: Line 50:
[http://typosphere.org/ Typo Home] [[http://typosphere.org/|Typo Home]]
Line 63: Line 63:
[http://wiki.splitbrain.org/doku.php DokuWiki Home] [[http://wiki.splitbrain.org/doku.php|DokuWiki Home]]

Making /stats accessible

Some 3rd party apps like Typo, WordPress, and Drupal will take over the directory .htaccess file where they are installed to provide nice and clean urls but doing so can break your /stats and other aliased requests.

The problem occurs because mod_rewrite is used to redirect all requests for non-existing files to the default file the CMS or program uses. A lot of hosting providers will install a stats package like Awstats for you, but instead of installing into your site directory they create a link or redirect.

Some examples follow, substitute stats for your situation. These examples all assume that they are in the .htaccess file created by your 3rd party app.

For Drupal

Drupal Home

# Rewrite URLs of the form 'index.php?q=x':
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/stats [NC]
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]

For Mambo

Mambo Home

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/stats [NC]
RewriteRule . /index.php [L]

For WordPress

WordPress Home

RewriteCond %{REQUEST_URI} ^/stats [NC]
RewriteRule . - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

For Typo

Typo Home

RewriteRule ^xml/([a-z]+)$ /xml/$1/feed.xml [R=301]
RewriteRule ^$ /index.html [QSA]
RewriteRule ^([^.]+)$ /$1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/stats [NC]
RewriteRule . dispatch.fcgi [QSA,L]

For DokuWiki

DokuWiki Home

RewriteEngine On
RewriteBase /dokuwiki/

RewriteRule ^_media/(.+) /lib/exe/fetch.php?media=$1 [QSA,L]
RewriteRule ^_detail/(.+) /lib/exe/detail.php?media=$1 [QSA,L]
RewriteRule ^_export/([^/]+)/(.+) /doku.php?do=export_$1&id=$2 [QSA,L]
RewriteRule ^$ /doku.php  [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/stats [NC]
RewriteRule ^(.+)$ /doku.php?id=$1 [QSA,L]
RewriteRule ^index\.php$ /doku.php

RewriteStatsBroken (last edited 2009-09-20 22:13:21 by localhost)