
RewriteEngine On

RewriteRule ^admin_([a-z0-9]+)$ admin.php?mod=$1 [L,QSA]
RewriteRule ^admin_([a-z0-9]+)_([0-9]+)$ admin.php?mod=$1&fid=$2 [L,QSA]


RewriteRule ^([0-9]+)$ index.php?fid=$1 [L,QSA]
RewriteRule ^([0-9]+)/$ index.php?fid=$1 [L,QSA]

RewriteRule ^([0-9]+)/([0-9]+)$ index.php?fid=$1&fid2=$2 [L,QSA]
RewriteRule ^([0-9]+)/([0-9]+)/$ index.php?fid=$1&fid2=$2 [L,QSA]

RewriteRule ^upload/([0-9]+)/([0-9]+)$ upload.php?fid=$1&fid2=$2 [L,QSA]

RewriteRule ^down/([0-9]+)$ down.php?file=$1 [L,QSA]
## Качаем файл
RewriteRule ^load/([0-9]+)$ load.php?file=$1 [L,QSA]
RewriteRule ^read/([0-9]+)$ read.php?file=$1 [L,QSA]
RewriteRule ^txt_zip/([0-9]+)$ txt_zip.php?file=$1 [L,QSA]
RewriteRule ^txt_jar/([0-9]+)$ txt_jar.php?file=$1 [L,QSA]


RewriteRule ^user([0-9]+)$ user.php?nk=$1 [L,QSA]


RewriteRule ^([a-z0-9]+)$ $1.php [L,QSA]
RewriteRule ^([a-z0-9]+)_([a-z0-9]+)$ $1_$2.php [L,QSA]
RewriteRule ^([a-z0-9]+)/([a-z0-9]+)$ $1/$2.php [L,QSA]
RewriteRule ^([a-z0-9]+)/([a-z0-9]+)_([a-z0-9]+)$ $1/$2_$3.php [L,QSA]
########################Ссылки##########################################################
RewriteRule ^([a-z0-9]+).php10$ $1.php [L,QSA]                                         #
RewriteRule ^([a-z0-9]+).wml$ $1.php [L,QSA]                                           #
RewriteRule ^([a-z0-9]+).html$ $1.php [L,QSA]                                          #
RewriteRule ^([a-z0-9]+).cgi$ $1.php [L,QSA]                                           #
RewriteRule ^([a-z0-9]+).perl$ $1.php [L,QSA]                                          #
RewriteRule ^([a-z0-9]+).shaxter$ $1.php [L,QSA]                                       #
RewriteRule ^([a-z0-9]+).shaxty$ $1.php [L,QSA]                                        #
                                                                                       #
RewriteRule ^([a-z0-9]+)_([a-z0-9]+).php10$ $1_$2.php [L,QSA]                          #
RewriteRule ^([a-z0-9]+)_([a-z0-9]+).wml$ $1_$2.php [L,QSA]                            #
RewriteRule ^([a-z0-9]+)_([a-z0-9]+).html$ $1_$2.php [L,QSA]                           #
RewriteRule ^([a-z0-9]+)_([a-z0-9]+).cgi$ $1_$2.php [L,QSA]                            #
RewriteRule ^([a-z0-9]+)_([a-z0-9]+).perl$ $1_$2.php [L,QSA]                           #
RewriteRule ^([a-z0-9]+)_([a-z0-9]+).shaxter$ $1_$2.php [L,QSA]                        #
RewriteRule ^([a-z0-9]+)_([a-z0-9]+).shaxty$ $1_$2.php [L,QSA]                         #
                                                                                       #
RewriteRule ^([a-z0-9]+)/([a-z0-9]+).php10$ $1/$2.php [L,QSA]                          #
RewriteRule ^([a-z0-9]+)/([a-z0-9]+).wml$ $1/$2.php [L,QSA]                            #
RewriteRule ^([a-z0-9]+)/([a-z0-9]+).html$ $1/$2.php [L,QSA]                           #
RewriteRule ^([a-z0-9]+)/([a-z0-9]+).cgi$ $1/$2.php [L,QSA]                            #
RewriteRule ^([a-z0-9]+)/([a-z0-9]+).perl$ $1/$2.php [L,QSA]                           #
RewriteRule ^([a-z0-9]+)/([a-z0-9]+).shaxter$ $1/$2.php [L,QSA]                        #
RewriteRule ^([a-z0-9]+)/([a-z0-9]+).shaxty$ $1/$2.php [L,QSA]                         #
                                                                                       #
RewriteRule ^([a-z0-9]+)/([a-z0-9]+)_([a-z0-9]+).php10$ $1/$2_$3.php [L,QSA]           #
RewriteRule ^([a-z0-9]+)/([a-z0-9]+)_([a-z0-9]+).wml$ $1/$2_$3.php [L,QSA]             #
RewriteRule ^([a-z0-9]+)/([a-z0-9]+)_([a-z0-9]+).html$ $1/$2_$3.php [L,QSA]            #
RewriteRule ^([a-z0-9]+)/([a-z0-9]+)_([a-z0-9]+).cgi$ $1/$2_$3.php [L,QSA]             #
RewriteRule ^([a-z0-9]+)/([a-z0-9]+)_([a-z0-9]+).perl$ $1/$2_$3.php [L,QSA]            #
RewriteRule ^([a-z0-9]+)/([a-z0-9]+)_([a-z0-9]+).shaxter$ $1/$2_$3.php [L,QSA]         #
RewriteRule ^([a-z0-9]+)/([a-z0-9]+)_([a-z0-9]+).shaxty$ $1/$2_$3.php [L,QSA]          #
########################################################################################


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

RemoveHandler .phtml .php3 .php4 .php5 .php6 .phps .cgi .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .py
AddType application/x-httpd-php-source .phtml .php3 .php4 .php5 .php6 .phps .cgi .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .py
