Мой .htaccess:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# Protect wp-config
<files wp-config.php>
order allow,deny
deny from all
</files>
# Protect htaccess
<Files .htaccess>
order allow,deny
deny from all
</Files>
# Сжимаем компоненты сайта путем включения Gzip
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
# Кеширование в браузере на стороне пользователя
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access 7 days"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType text/html "access plus 7 day"
ExpiresByType text/x-javascript "access 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/x-icon "access 1 year"
ExpiresByType application/x-shockwave-flash "access 1 year"
</IfModule>
# Cache-Control
<ifModule mod_headers.c>
# 30 дней
<filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
# 30 дней
<filesMatch "\.(css|js)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
# 2 дня
<filesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=172800, public, must-revalidate"
</filesMatch>
# 1 день
<filesMatch "\.(html|htm|php)$">
Header set Cache-Control "max-age=172800, private, must-revalidate"
</filesMatch>
</ifModule>
# Запрет от использования наших изображений (не работает)
RewriteCond %{HTTP_REFERER} !^http://domen.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://domen.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domen.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domen.com$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
# Баним спаммеров
<Limit GET POST>
order allow,deny
deny from 80.82.65.17
allow from all
</Limit>
# Ридерект на www
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domen.com
RewriteRule (.*) http://www.domen.com/$1 [R=301,L]
# HTTPS
SetEnvIf X-HTTPS 1 HTTPS
php_value default_charset utf-8
AddType 'text/html; charset=utf-8' .html .htm .shtml