#
# Copyright (C) 2006-2008 2z project (http://2z-project.com)
# Name: .htaccess
# Description: mod_rewrite htaccess file
# Author: 2z project team
#

DirectoryIndex index.php

<files .htaccess>
order allow,deny 
deny from all
</files>

php_flag register_globals off
php_flag magic_quotes_gpc off
php_flag magic_quotes_runtime off
php_flag magic_quotes_sybase off
php_flag allow_call_time_pass_reference on

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [S=35]

# Editable links
RewriteRule ^category/([^/]*)(/?)+$ /?category=$1 [QSA,L]
RewriteRule ^category/([^/]*)/page/([0-9]+)(/?)+$ /?category=$1&cstart=$2 [QSA,L]
RewriteRule ^category/([^/]*)/(feed|rss|rss2).xml(/?)+$ /?action=plugin&plugin=rss_export&category=$1 [QSA,L]
RewriteRule ^category/([^/]*)/(.*)/([0-9]+).(htm|html)(/?)+$ /?category=$1&altname=$2&page=$3 [QSA,L]
RewriteRule ^category/([^/]*)/(.*).(htm|html)(/?)+$ /?category=$1&altname=$2 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{1,2})/(.*).(htm|html)(/?)+$ /?year=$1&month=$2&day=$3&altname=$4 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{1,2})/(.*)/([0-9]+).(htm|html)(/?)+$ /?year=$1&month=$2&day=$3&altname=$4&page=$5 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{1,2})/(.*).print(/?)+$ 2z/includes/print.php?year=$1&month=$2&day=$3&altname=$4 [QSA,L]
RewriteRule ^category/([^/]*)/(.*).print(/?)+$ 2z/includes/print.php?category=$1&altname=$2 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$ /?year=$1&month=$2&day=$3 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$ /?year=$1&month=$2&day=$3&cstart=$4 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{2})(/?)+$ /?year=$1&month=$2 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$ /?year=$1&month=$2&cstart=$3 [QSA,L]
RewriteRule ^([0-9]{4})(/?)+$ /?year=$1 [QSA,L]
RewriteRule ^([0-9]{4})/page/([0-9]+)(/?)+$ /?year=$1&cstart=$2 [QSA,L]
RewriteRule ^users/([^/]*)(/?)+$ /?action=users&user=$1 [QSA,L]
RewriteRule ^registration(/?)+$ /?action=registration [QSA,L]
RewriteRule ^activation(/?)+$ /?action=activation [QSA,L]
RewriteRule ^activation/([0-9]{1,7})/([^/]*)(/?)+$ /?action=activation&userid=$1&code=$2 [QSA,L]
RewriteRule ^lostpassword(/?)+$ /?action=lostpassword [QSA,L]
RewriteRule ^(feed|rss|rss2).xml(/?)+$ /?action=plugin&plugin=rss_export [QSA,L]
RewriteRule ^page(/?)+$ /?cstart=0 [QSA,L]
RewriteRule ^page/(.*)$ /?cstart=$1 [QSA,L]
RewriteRule ^profile(/?)+$ /?action=profile [QSA,L]
RewriteRule ^addnews(/?)+$ /?action=addnews [QSA,L]
RewriteRule ^static/(.*).(htm|html)(/?)+$ ?action=static&altname=$1 [QSA,L]
RewriteRule ^plugin/([^/]*)(/?)+$ ?action=plugin&plugin=$1 [QSA,L]
