Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Httpd Wiki" for change 
notification.

The following page has been changed by HtaccessElite:
http://wiki.apache.org/httpd/RewriteStatsBroken

The comment on the change is:
hope this flies

New page:
= 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 ===

[http://drupal.org/ 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 ===

[http://www.mamboserver.com/ Mambo Home]

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

=== For WordPress ===

[http://wordpress.org/ WordPress Home]

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

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

=== For Typo ===

[http://typosphere.org/ 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 ===

[http://wiki.splitbrain.org/doku.php 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
}}}

Reply via email to