ErrorDocument 404 /?error
ErrorDocument 400 /?error
RewriteEngine On

RewriteRule ^payment/interkassa.aspx$ payment/interkassa.php [L,QSA]
RewriteRule ^payment/success.aspx$ payment/success.php [L,QSA]
RewriteRule ^payment/nicmas.aspx$ payment/nicmas.php [L,QSA]
RewriteRule ^payment/error.aspx$ payment/error.php [L,QSA]

RewriteRule ^auth.aspx$ moduls/auth.php [L,QSA]
RewriteRule ^registration.aspx$ moduls/registration.php [L,QSA]
RewriteRule ^exit.aspx$ index.php?exit [L,QSA]
RewriteRule ^cab.aspx$ moduls/cab.php [L,QSA]
RewriteRule ^setting.aspx$ moduls/setting.php [L,QSA]
RewriteRule ^rules.aspx$ moduls/rules.php [L,QSA]
RewriteRule ^platform/my.aspx$ moduls/platform.php [L,QSA]
RewriteRule ^platform/add.aspx$ moduls/platform.php?act=add [L,QSA]
RewriteRule ^platform/profit/([0-9]*).aspx?$ moduls/platform.php?act=profit&id=$1 [L,QSA] 
RewriteRule ^platform/edit/([0-9]*).aspx?$ moduls/platform.php?act=edit&id=$1 [L,QSA] 
RewriteRule ^platform/money/([0-9]*).aspx?$ moduls/platform.php?act=money&id=$1 [L,QSA] 
RewriteRule ^platform/stat/([0-9]*).aspx?$ moduls/stat_platform.php?id=$1 [L,QSA] 
RewriteRule ^platform/history.aspx$ moduls/history_money.php [L,QSA]
RewriteRule ^platform/history-clean.aspx$ moduls/history.php?del [L,QSA]
RewriteRule ^mail/my.aspx$ moduls/my_mail.php [L,QSA]
RewriteRule ^mail/([0-9]*)/dialog.aspx?$ moduls/mail.php?id=$1 [L,QSA] 
RewriteRule ^chat.aspx$ moduls/chat.php [L,QSA]
RewriteRule ^users.aspx$ moduls/users.php [L,QSA]
RewriteRule ^stat.aspx$ moduls/stat.php [L,QSA]
RewriteRule ^ads/$ moduls/ads/index.php [L,QSA]
RewriteRule ^ads/pay.aspx$ moduls/ads/pay.php [L,QSA]
RewriteRule ^ads/error.aspx$ moduls/ads/error.php [L,QSA]
RewriteRule ^ads/success.aspx$ moduls/ads/success.php [L,QSA]
RewriteRule ^ads/result.aspx$ moduls/ads/result.php [L,QSA]
RewriteRule ^auth_who.aspx$ moduls/who_auth.php [L,QSA]
#OutPut#
RewriteRule ^platform/moneyback.aspx$ moduls/platform.php?act=moneyback [L,QSA]
RewriteRule ^platform/my/pay.aspx$ moduls/platform.php?act=pay [L,QSA]
#Tikets#
RewriteRule ^my/tikets.aspx$ moduls/tikets/index.php [L,QSA]
RewriteRule ^my/tikets/add.aspx$ moduls/tikets/add.php [L,QSA]
RewriteRule ^my/tikets/admin.aspx$ moduls/tikets/admin.php [L,QSA]
RewriteRule ^my/tikets/info_([0-9]*).aspx?$ moduls/tikets/info.php?id=$1 [L,QSA] 
#Control panel#
RewriteRule ^panel.aspx$ moduls/panel.php [L,QSA]
RewriteRule ^panel/$ moduls/panel.php [L,QSA]
RewriteRule ^panel/moneyback/view.aspx$ moduls/panel.php?act=moneyback [L,QSA]
RewriteRule ^panel/moneyback/([0-9]*).aspx?$ moduls/panel.php?act=output&id=$1 [L,QSA] 
RewriteRule ^panel/platform/view.aspx$ moduls/panel.php?act=platform [L,QSA]
RewriteRule ^panel/platform/([0-9]*).aspx?$ moduls/panel.php?act=platformblock&id=$1 [L,QSA] 
RewriteRule ^panel/news/view.aspx$ moduls/panel.php?act=news [L,QSA]
#Cabinet#
RewriteRule setting/my/(.*?).aspx$ moduls/setting/$1.php [L]
RewriteRule panel/my/(.*?).aspx$ moduls/panel/$1.php [L]
#Pay#
RewriteRule ^payment/([0-9]*).aspx?$ payment/pay/index.php?id=$1 [L,QSA] 
RewriteRule ^payment/wordpay.aspx$ payment/pay/wordpay.php [L,QSA]
RewriteRule ^payment/test.aspx$ payment/pay/test.php [L,QSA]
RewriteRule ^payment/check.aspx$ payment/check.php [L,QSA]
RewriteRule ^payment/hash.aspx$ payment/hash.php [L,QSA]
RewriteRule ^payment/wapkassa.aspx$ payment/pay/wapkassa/index.php [L,QSA]
RewriteRule ^payment/worldkassa.aspx$ payment/pay/worldkassa/index.php [L,QSA]

#Кэш#
<filesMatch ".(css|jpg|jpeg|png|gif|js|ico)$">
    Header set Cache-Control "max-age=2592000, public"
  </filesMatch>
  RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
  RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
  # Включаем кэширование в браузерах клиентов
<ifModule mod_headers.c>
 
    # html и htm файлы будут храниться сутки
    <FilesMatch "\.(html|htm)$">
        Header set Cache-Control "max-age=43200"
    </FilesMatch>
 
    # css, javascript и текстовые файлы будут храниться неделю
    <FilesMatch "\.(js|css|txt)$">
        Header set Cache-Control "max-age=604800"
    </FilesMatch>
 
    # флэш файлы и изображения будут храниться месяц
    <FilesMatch "\.(flv|swf|ico|gif|jpg|jpeg|png)$">
        Header set Cache-Control "max-age=2592000"
    </FilesMatch>
 
    # Запрещаем кеширование служебных файлов
    <FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
        Header unset Cache-Control
    </FilesMatch>
 
</IfModule>
# сжатие text, html, javascript, css, xml:
<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript
</ifModule>
#Конец кэша