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