2011-06-13, 07:31:13
I'm having a bit of trouble with the .htaccess mod_rewrite rules as I have quite a few already and I'm not sure where the News Manager rules should go. Where they are currently doesn't seem to be working (News Manager links in the front-end just get redirected to the home page) but every other mod_rewrite rule there works as expected.
Anyone see a problem there?
Code:
<IfModule mod_rewrite.c>
# Turn on the rewrite engine.
RewriteEngine On
# FILE NAME VERSIONING TO CACHE BUST
# Requests for "/res/all.20110101.css" serve up "/res/all.css", etc.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpe?g|gif|ttf|eot|svg|woff)$ $1.$3 [L]
# COOKIE-LESS SUB-DOMAINS FOR STATIC FILES
# If the hostname isn't www.domain.com AND requested file's extension
# isn't in the filter list, change host to www.domain.com.
RewriteCond %{HTTP_HOST} !^www\.spare\.co\.nz$ [NC]
RewriteCond %{REQUEST_FILENAME} !\.(js|css|png|jpe?g|gif|ttf|eot|svg|woff)$ [NC]
RewriteRule (.*) http://www.spare.co.nz/$1 [R=301,L] #
# FORCE "FOLDERS" AS CANONICAL
# Rewrite "domain.com/foo -> domain.com/foo/".
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/|#(.*))$
RewriteRule ^(.*)$ /$1/ [R=301,L]
# Extra rules for the GetSimple plugin "News Manager".
RewriteRule ^tag/([^/.]+)/?$ index.php?tag=$1 [L]
RewriteRule ^post/([^/.]+)/?$ index.php?post=$1 [L]
RewriteRule ^page/([^/.]+)/?$ index.php?page=$1 [L]
RewriteRule ^archive/([^/.]+)/?$ index.php?archive=$1 [L]
# Rewrites for GetSimple
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
</IfModule>
Anyone see a problem there?