axtg/CompactCMS/master/.htaccess - Htaccess File

axtg/CompactCMS/master/.htaccess

##
#
# Copyright 2008 - 2010 by CompactCMS.nl. All rights reserved.
# This file is part of CompactCMS (refer to license.txt)
# Revision: CompactCMS - 1.4.1
#
##

AddDefaultCharset utf-8
Options +FollowSymLinks
RewriteEngine On 

## 
# Start modification
# Make sure the RewriteBase variable reflects your file structure
##

# For an installation under root use / (default)
# For an installation under /ccms use /ccms/
RewriteBase /

##
# End modification
##

##
# It's a good idea to make www. and non www. redirect to either one
# Adjust the two lines below and UNCOMMENT both lines (remove #'s)
##

# RewriteCond %{HTTP_HOST} ^www.mysite.com [NC] 
# RewriteRule ^(.*)$ http://mysite.com/$1 [L,R=301]

##
# Various rewrite rules
##

RewriteRule ^([^/]*)/([^/]*).html$             index.php?page=$1&id=$2 [QSA,L]
RewriteRule ^([^/]*)/([^/]*).print$            index.php?page=$1&id=$2&printing=Y [QSA,L]
RewriteRule ^([^/]+).html$                     index.php?page=$1 [QSA,L]
RewriteRule ^([^/]+).print$                    index.php?page=$1&printing=Y [QSA,L]
RewriteRule ^lib/includes/js/([^/]+.js)$       lib/includes/combine.inc.php?type=javascript&files=$1 [L]
RewriteRule ^admin/img/styles/([^/]+.css)$     lib/includes/combine.inc.php?type=css&files=$1 [L]    
# pull EVERY OTHER JS/CSS file through combine as well: that's our generic cacher/compressor/optimizer
RewriteRule ^(.+)/([^/]+.js)$                  lib/includes/combine.inc.php?type=javascript&files=$2&jsdir=$1 [L]
RewriteRule ^(.+)/([^/]+.css)$                 lib/includes/combine.inc.php?type=css&files=$2&cssdir=$1 [L]
RewriteRule ^sitemap.xml$                      index.php?page=sitemap [L]

##
# Security measures
##
RewriteCond %{QUERY_STRING} (.*)(http|https|ftp)://(.*)
RewriteRule ^(.+)$ - [F]

<IfModule mod_security.c>
    SecFilterEngine On
    SecFilterDefaultAction "deny,log,status:403"
    SecFilterScanPOST On
    SecFilterCheckURLEncoding On
    SecFilterCheckUnicodeEncoding Off
</IfModule>

##
# The lines below improve loading times for the administration, following the best practice
# rules from: http://developer.yahoo.com/performance/rules.html. Note that both the Apache
# modules mod_deflate and mod_headers are required for this to work. Falls back nicely if 
# not enabled.
##

<IfModule mod_deflate.c>
    SetOutputFilter DEFLATE
</IfModule>

<IfModule mod_headers.c>
    <FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4)$">
    Header set Cache-Control "public"
    Header set Expires "Fri, 1 Jun 2012 20:00:00 GMT"
    Header unset Last-Modified
    </FilesMatch>
    <FilesMatch ".(html|htm|xml|txt|xsl)$">
    Header set Cache-Control "max-age=7200, must-revalidate"
    </FilesMatch>
    <FilesMatch ".(js|css)$">
    Header set Cache-Control "public"
    Header set Expires "Sun, 1 Jun 2014 20:00:00 GMT"
    Header unset Last-Modified
    </FilesMatch>
    
    Header unset ETag
    Header unset Pragma
</IfModule>

FileETag None

On Github License

Files

Download PDF of Htaccess file
DEFLATE, HTTP_HOST, POST, Pragma, QUERY_STRING

Comments

Apache