Problem with CMS/Stats

Ask your mod_rewrite and Redirection questions here, and get answers!

Problem with CMS/Stats

Postby produke » 26 Oct 2006 19:10

Problem with /Stats

Some 3rd party apps like WordPress, Drupal will take over your directory structure to give you a nice clean url but in the process break your /stats page.

Quick Fix:
Code: Select all
RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/failed_auth.html$
RewriteRule ^.*$ - [L]


* For Drupal:

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


* For Mambo

Code: Select all
# Rewrite URLS of the form 'index.php' ... mambo doesn't take the query string as a parameter
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/stats/(.*)$
RewriteCond %{REQUEST_URI} !^/failed_auth.html$
RewriteRule ^(.*)$ index.php [L]


* For WordPress:

Code: Select all
RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]


* For Typo:

Code: Select all
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/(.*)$
RewriteCond %{REQUEST_URI} !^/failed_auth.html$
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]


* For MediaWiki

This depends on how you install Mediawiki and whether you use mod_rewrite to get clean URLs. If you install it correctly, /stats will not be broken. See the alternate simpler method of getting clean URLs for install instructions that do not break /stats.
User avatar
produke
 
Posts: 242
Joined: 25 Sep 2006 04:48

Return to Redirect or Rewrite Questions



Who is online

Users browsing this forum: ShakhtarrDon