Файл: .htaccess
Строк: 220
#MIME-типы
AddHandler application/x-httpd-php .php .phtml
AddType
text/vnd.wap.wml .wml
AddType text/vnd.wap.wmlscript .wmls
AddType
text/vnd.wap.si .si
AddType text/vnd.wap.sl .sl
AddType
text/vnd.sun.j2me.app-descriptor .jad
AddType
text/vnd.sun.j2me.app-descriptor .db
AddType text/x-vcard .vcf
AddType
text/x-vcalendar .vcs
AddType text/x-vmel .mel
AddType text/x-vmel
.emy
AddType text/x-co-desc .cod
AddType text/x-emelody .emy
AddType
text/calendar .ics
AddType text/x-imelody .imy
AddType text/plain
.txt
AddType text/plain .dat
AddType text/xml .xml
AddType text/css
.css
AddType text/javascript .js
AddType application/java-archive
.jar
AddType application/vnd.wap.wmlc .wmlc
AddType
application/vnd.wap.wmlscriptc .wmlsc
AddType application/vnd.wap.slc
.slc
AddType application/vnd.wap.sic .sic
AddType application/vnd.eri.thm
.thm
AddType application/vnd.nok-s40theme .nth
AddType
application/vnd.Nokie.ringing-tone .rng
AddType
application/vnd.nokia.gamedata .nqd
AddType application/x-nokiagamedata
.ngd
AddType application/vnd.alcatel.SEQ .seq
AddType
application/vnd.uiq.thm .utz
AddType application/vnd.mophun.application
.mpn
AddType application/vnd.mophun.certificate .mpc
AddType
application/vnd.sonyericsson.mms-template tpl
AddType
application/vnd.siemens-mp.theme .sdt
AddType
application/vnd.siemens-mp.skin .scs
AddType
application/vnd.siemens-mp.t9db .ldb
AddType
application/vnd.ms-cab-compressed .cab
AddType
application/vnd.symbian.install .sis
AddType application/octet-stream
.sisx
AddType application/vnd.symbian.install .app
#AddType
application/x-httpd-php .rss
AddType application/x-compress .z
AddType
application/x-7z-compressed .7z
AddType application/x-rar-compressed
.rar
AddType application/x-zip .zip
AddType application/x-gzip .gz
AddType
application/x-gzip .tgz
AddType application/x-tar .tar
AddType
application/x-bzip .bz
AddType application/x-bzip .bz2
AddType
application/x-tar .hid
AddType application/chm .chm
AddType
application/x-pmd .pmd
AddType application/smil .smil
AddType
application/smil .smi
AddType application/vnd.smaf .mmf
AddType
application/vnd .smaf
AddType application/vnd.wap.mms-message .mms
AddType
application/vnd.oma.drm.message .dm
AddType application/x-dvi .dvi
AddType
application/msword .doc
AddType application/pdf .pdf
AddType
application/postscript .ps
AddType application/postscript .eps
AddType
application/x-tex .tex
AddType application/octet-stream .com
AddType
application/octet-stream .exe
AddType audio/basic .au
AddType audio/basic
.snd
AddType audio/imelody .imy
AddType audio/mid .srt
AddType audio/mid
.midi
AddType audio/mid .mid
AddType audio/mid .col
AddType audio/mpeg
.mp3
AddType audio/aac .aac
AddType audio/amr .amr
AddType audio/amr-wb
.awb
AddType audio/rmf .rmf
AddType audio/vnd.qcelp .qcp
AddType audio/aiff
.aiff
AddType audio/x-wav .wav
AddType audio/x-ms-wma .wma
AddType
image/vnd.wap.wbmp .wbmp
AddType image/bmp .bmx
AddType image/png
.png
AddType image/jpeg .jpg
AddType image/jpeg .jpe
AddType image/jpeg
.jpeg
AddType image/gif .gif
AddType image/bmp .bmp
AddType
image/x-epoc-mbm .mbm
AddType image/vnd.nok-3dscreensaver .n3a
AddType
image/x-epoc-mbm .mbm
AddType image/vnd.nok-3dscreensaver .n3a
AddType
image/vnd.nok-oplogo-colornokia-op-logo .nok
AddType image/x-jg
.art
AddType image/tiff .tiff
AddType video/3gpp .3gp
AddType video/mp4
.mp4
AddType video/mpeg .mpeg
AddType video/mpeg .mpg
AddType video/mpeg
.mpe
AddType video/quicktime .mov
AddType video/quicktime .qt
AddType
video/x-msvideo .avi
AddType video/x-ms-wmv .wmv
AddType video/x-ms-asf
.asf
AddType video/x-ivf .ivf
AddType x-world/x-vrml .wrl
AddType
text/vnd.wap.wml;charset=utf-8 .wml
Addtype audio/wav .wav
AddType
text/sun.j2me.app-descriptor .jad
AddType
text/vnd.sun.j2me.app-descriptor;charset=UTF-8 .jad
AddType
application/vnd.symbian.install sis
AddType application/vnd.symbian.install
sisx
AddType application/x-shockwave-flash .swf
#сжатие по
типам - если модуль включен
<ifModule
mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime
^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader
^Content-Encoding:.*gzip.*
</ifModule>
###Продолжение
кэширования по другому модулю
<ifModule
mod_expires.c>
ExpiresActive On
#по умолчанию кеш в 5
секунд
#ExpiresDefault "access plus 5
seconds"
#кэшировать флэш и изображения на
месяц
ExpiresByType image/x-icon "access plus 3600
seconds"
ExpiresByType image/jpeg "access plus 3600
seconds"
ExpiresByType image/png "access plus 3600
seconds"
ExpiresByType image/gif "access plus 3600
seconds"
ExpiresByType application/x-shockwave-flash "access plus
3600 seconds"
#кэшировать css, javascript и
текстовые файлы на одну неделю
ExpiresByType
text/css "access plus 3600 seconds"
ExpiresByType text/javascript
"access plus 3600 seconds"
ExpiresByType application/javascript
"access plus 3600 seconds"
ExpiresByType application/x-javascript
"access plus 3600 seconds"
#кэшировать html и htm
файлы на один день
#ExpiresByType text/html "access
plus 3600 seconds"
#кэшировать xml файлы на
десять минут
#ExpiresByType application/xhtml+xml "access
plus 600 seconds"
</ifModule>
#
Отладка
#Временная зона сайта
php_value
date.timezone "Europe/Moscow"
# Кодировка по
умолчанию
#php_value default_charset UTF-8
AddDefaultCharset
utf-8
# ставим MIME тип по умолчанию
# php_value
default_mimetype text/html
# Отображение ошибок и
предупреждений PHP
# На боевом сервере
лучше отключать, чтобы не дать
потенциальному хакеру лишней
информации
#отключаем вывод ошибок - в
лог писаться будут, а пользователю
незачем видеть
php_flag display_errors off
php_flag
display_startup_errors off
php_flag log_errors off
php_flag
ignore_repeated_errors off
php_flag ignore_repeated_source off
php_flag
html_errors off
php_flag report_memleaks off
php_flag track_errors
off
php_value docref_root 0
php_value docref_ext 0
#
Индификаторы сессии
php_flag session.use_cookies
on
php_value session.use_trans_sid 1
php_value session.gc_maxlifetime
360000
php_value session.cookie_lifetime 360000
# Устаревшие
суперглобальные масивы
# php_flag register_long_arrays
Off
php_value error_reporting 0
# php_value register_globals 1
# php_flag
register_globals on
php_flag register_globals Off
php_flag short_open_tag
On
# "магические" кавычки, желательно
отключить
php_value magic_quotes_gpc 0
# php_flag
magic_quotes_runtime Off
# php_flag magic_quotes_sybase Off
#скрыть
подпись сервера
ServerSignature Off
#позволяет
использовать символические ссылки на
файлы или каталоги вне корня сайта
Options
+FollowSymLinks
#включение режима
перенаправления - в идеале лучше
проверять наличие модуля, но его
отсутствие/невключение достаточно редко
(все правила включить между <IfModule
mod_rewrite.c> и </IfModule>
RewriteEngine On
#указываем
корень перенаправления - если, например,
сайт в подпапке, то указывается эта папка
как отправная точка отсчета
RewriteBase /
#
Индексный Файл
IndexIgnore *.php
#запрещает
показывать содержимое каталогов, если в
них нет индексного файла
Options -Indexes
# INDEX
FILE
DirectoryIndex index.php
# Bad Rquest
ErrorDocument 400 /400.html
#
Authorization Required
ErrorDocument 401 /401.shtml
#
Forbidden
ErrorDocument 403 /403.shtml
# Not found
ErrorDocument 404
/error.php
# Method Not Allowed
ErrorDocument 405 /405.html
# Request Timed
Out
ErrorDocument 408 /408.html
# Request URI Too Long
ErrorDocument 414
/414.html
# Internal Server Error
ErrorDocument 500 /500.html
# Not
Implemented
ErrorDocument 501 /501.html
# Bad Gateway
ErrorDocument 502
/502.html
# Service Unavailable
ErrorDocument 503 /503.html
# Gateway
Timeout
ErrorDocument 504 /504.html
#чпу файлов
RewriteRule
^([a-z_]+)(/?)$ /$1.php
<Files 403.shtml>
order allow,deny
allow
from all
</Files>