# Кодировка по умолчанию
AddDefaultCharset UTF-8

# INDEX
DirectoryIndex index.php
Options -Indexes

# Мод Rewrite
RewriteEngine On
RewriteRule ^(\d+).cnt$ index.php?action=counter&id=$1

RewriteRule ^index.html/category/(\d+)$ index.php?action=index&category=$1 [L]
RewriteRule ^index.html/category/(\d+)/page.(\d+)$ index.php?action=index&category=$1&page=$2 [L]

RewriteRule ^stat.html/(.*)/(\d+)/(.*)/$ index.php?action=stat&act=$1&id=$2&wrap=$3 [L]
RewriteRule ^stat.html/(.*)/(\d+)/(.*)/page.(\d+)$ index.php?action=stat&act=$1&id=$2&wrap=$3&page=$4 [L]

RewriteRule ^(.*).html/(.*)/$ index.php?action=$1&act=$2 [QSA,L]
RewriteRule ^(.*).html$ index.php?action=$1 [QSA,L]
RewriteRule ^(.*).html/page.(\d+)$ index.php?action=$1&page=$2 [QSA,L]
RewriteRule ^(.*).html/(\d+)$ index.php?action=$1&id=$2 [QSA,L]
RewriteRule ^(.*).html/(\d+)/page.(\d+)$ index.php?action=$1&id=$2&page=$3 [QSA,L]
RewriteRule ^(.*).html/(.*)/$ index.php?action=$1&act=$2 [QSA,L]
RewriteRule ^(.*).html/(.*)/page.(\d+)$ index.php?action=$1&act=$2&page=$3 [QSA,L]
RewriteRule ^(.*).html/(.*)/(\d+)$ index.php?action=$1&act=$2&id=$3 [QSA,L]
RewriteRule ^(.*).html/(.*)/(\d+)/page.(\d+)$ index.php?action=$1&act=$2&id=$3&page=$4 [QSA,L]

RewriteRule ^(\d+)-(.*)$ index.php?action=authenticate&id=$1&password=$2

# Запрещаем просмотр системных файлов
<FilesMatch "(function|cron).php$">
	Deny from all
</FilesMatch>

# Компрессия
php_flag zlib.output_compression On
php_value zlib.output_compression_level 6

# Отладка
php_value date.timezone "Europe/Moscow"
php_value arg_separator.output "&amp;"
php_flag register_globals Off
php_flag register_long_arrays Off

# Магические ковычки
php_flag magic_quotes_gpc Off
php_flag magic_quotes_runtime Off
php_flag magic_quotes_sybase Off

# Страница ошибок
ErrorDocument 403 /error.html
ErrorDocument 404 /error.html