###################################################
# Turn the RewriteEngine on. #
###################################################
RewriteEngine on
RewriteRule ^/js/tracking.js /tracking.php
###################################################
# Add a leading www to domain if one is missing. #
###################################################
# If this rule is used, the rewriting stops here #
# and then restarts from the beginning with the #
# new URL #
###################################################
RewriteCond %{HTTP_HOST} !(^www\.)
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
###################################################
# Do not process images or CSS files further #
###################################################
# No more processing occurs if this rule is #
# successful #
###################################################
RewriteRule \.(css|jpe?g|gif|js|txt|xml|png)$ - [L]
###################################################
# Add a trailing slash if needed #
###################################################
# If this rule is used, the rewriting stops here #
# and then restarts from the beginning with the #
# new URL #
###################################################
RewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L]
###################################################
# Rewrite web pages to one master page #
###################################################
# /somepage/ => master.php #
# ?class=somepage #
# /somesection/somepage => master.php #
# ?class=somesection #
# &method=somepage #
# /somesection/somesub/somepage/optn #
# => master.php #
# ?class=somesection #
# &method=somesub #
# ¶ms=somepage #
# &options=optn #
###################################################
# Variables are accessed in PHP using #
# $_GET['class'], $_GET['method'] and #
# $_GET['params'], $_GET['options'] #
###################################################
# No more processing occurs if any of these rules #
# are successful #
###################################################
RewriteRule ^([^/\.]+)/?$ /master.php?class=$1&method=main [L]
RewriteRule ^([^/\.]+)/([^/\.]+)/?$ /master.php?class=$1&method=$2 [L]
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ /master.php?class=$1&method=$2¶ms=$3 [L]
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ /master.php?class=$1&method=$2¶ms=$3&options=$4 [L]
###################################################
# Over-Ride the ini settings of the server #
###################################################
php_flag display_errors on
php_flag short_open_tag false
###################################################
# Set the PHP value for error reporting #
###################################################
php_value error_reporting 6135