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

# INDEX
DirectoryIndex index.php
Options -Indexes

# Кэширование файлов
FileETag MTime Size 
<ifmodule mod_expires.c> 
	<filesmatch ".(jpg|gif|png|css|js)$"> 
		ExpiresActive on 
		ExpiresDefault "access plus 1 year" 
	</filesmatch> 
</ifmodule>

# Мод Rewrite
RewriteEngine On
RewriteRule ^(.*).xhtml/*$ $1.php [QSA,L]
RewriteRule ^(\d+)/(id|name|load|dateupload|rate).sort$ index.php?id=$1&sort=$2 [L]
RewriteRule ^page.(\d+)/*$ index.php?page=$1 [L]
RewriteRule ^(\d+).archive/page.(\d+)/*$ archive.php?id=$1&page=$2 [L]
RewriteRule ^(\d+).archive/path,(.*)/*$ archive.php?id=$1&view=$2 [L]
RewriteRule ^view/(\d+)/*$ view.php?id=$1 [L]
RewriteRule ^view/(\d+)/(plus|minus).rate/*$ view.php?id=$1&rate=$2 [L]
RewriteRule ^(\d+)/*$ index.php?id=$1 [L]
RewriteRule ^update.xhtml/(\d+)/*$ update.php?id=$1 [L]
RewriteRule ^update.xhtml/page.(\d+)/*$ update.php?page=$1 [L]
RewriteRule ^(\d+)/page.(\d+)/*$ index.php?id=$1&page=$2 [L]
RewriteRule ^(\d+).(zip|load|article|theme|archive|comment)$ $2.php?id=$1 [L]

RewriteRule ^(\d+).archive/page.(\d+)/*$ archive.php?id=$1&page=$2 [L]
RewriteRule ^(\d+).archive/path,(.*)/*$ archive.php?id=$1&view=$2 [L]
RewriteRule ^(\d+)\[small\].theme$ theme.php?id=$1&size=1 [L]
RewriteRule ^(\d+).article/page.(\d+)/*$ article.php?id=$1&page=$2 [L]
RewriteRule ^(\d+).jad$ jad.php?id=$1&load [L]
RewriteRule ^(\d+).ffmpeg$ image.php?id=$1&ffmpeg [L]
RewriteRule ^(\d+).img$ image.php?id=$1 [L]
RewriteRule ^(.*).image$ image.php?img=$1 [L]
RewriteRule ^(\d+)\[(\d{2,4}+)x(\d{2,4}+)\].img$ image.php?id=$1&w=$2&h=$3 [L]
RewriteRule ^(\d+)\[(\d{2,4}+)x(\d{2,4}+)\].ffmpeg$ image.php?id=$1&w=$2&h=$3&ffmpeg [L]
RewriteRule ^com([0-9]*)/$ comes.php?id=$1 [L,QSA]
RewriteRule ^com([0-9]*)$ comes.php?id=$1 [L,QSA]
RewriteRule ^reit([0-9]*)/$ reit.php?id=$1 [L,QSA]
RewriteRule ^reit([0-9]*)$ reit.php?id=$1 [L,QSA]


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

# Отладка
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

# Задаем соответствие mime типов расширению
Addtype application/zip .zip
Addtype application/x-rar-compressed .rar
AddType application/vnd.sonyericsson.mms-template tpl
AddType application/vnd.eri.thm .thm 
AddType application/vnd.mophun.application .mpn  
AddType application/vnd.mophun.certificate .mpc
AddType application/vnd.smaf .mmf
AddType application/x-tar .hid
Addtype application/smil .smil 
Addtype application/smil .smi 
Addtype application/java-archive .jar 
Addtype application/vnd.symbian.install .sis
Addtype application/vnd.wap.mms-message .mms
Addtype application/octet-stream .exe

Addtype text/x-imelody .imy 
Addtype text/x-emelody .emy 
Addtype text/x-vcard .vcf 
Addtype text/x-vcalendar .vcs 
Addtype text/calendar .ics
AddType text/vnd.sun.j2me.app-descriptor;charset=UTF-8 .jad
addtype text/x-vmel .mel
addtype text/x-vmel .emy

addtype audio/imelody .imy
AddType audio/amr .amr
AddType audio/x-wav .wav
Addtype audio/wav .wav 
Addtype audio/midi .midi 
Addtype audio/midi .mid 
Addtype audio/rmf .rmf

Addtype image/jpeg .jpg 
Addtype image/jpeg .jpeg 
Addtype image/gif .gif 
Addtype image/png .png 
Addtype image/bmp .bmp 

AddType video/mp4 .mp4
Addtype video/3gpp .3gp