File: /var/www/cod67/data/www/cod67.ru/public_html/.htaccess1111111111111111
# This file was updated by Duplicator on 2018-05-28 02:59:26. See .htaccess.orig for the original .htaccess file.
# Please note that other plugins and resources write to this file. If the time-stamp above is different
# than the current time-stamp on the file system then another resource has updated this file.
# Duplicator only writes to this file once during the install process while running the installer.php file.
# Безопасность - запрет на просмотр файлов
Options -Indexes
# Защита от подделки межсайтовых запросов (CSRF) для форм
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} .(wp-comments-post|wp-login)\.php*
RewriteCond %{HTTP_REFERER} !^https?://(.*)?your-site\.com [NC]
RewriteCond %{HTTP_REFERER} !^https?://(.*)?localhost [NC]
RewriteRule .* - [F]
</IfModule>
# Блокировка доступа к чувствительным файлам
<FilesMatch "^.*(error_log|wp-config\.php|php.ini|\.[hH][tT][aApP].*)$">
Order deny,allow
Deny from all
</FilesMatch>
# Блокировка доступа к XML-RPC (если не используется)
<Files xmlrpc.php>
Order deny,allow
Deny from all
</Files>
# BEGIN WordPress
# Директивы (строки) между `BEGIN WordPress` и `END WordPress`
# созданы автоматически и подлежат изменению только через фильтры WordPress.
# Сделанные вручную изменения между этими маркерами будут перезаписаны.
<IfModule mod_rewrite.c>
RewriteEngine On
# Установка HTTP_AUTHORIZATION для серверов, которые ее удаляют
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Перенаправление с www на без www (или наоборот - выберите один вариант)
# Для перенаправления с www на без www:
# RewriteCond %{HTTP_HOST} ^www\.your-site\.com [NC]
# RewriteRule ^(.*)$ https://your-site.com/$1 [L,R=301]
# Для перенаправления с HTTP на HTTPS
# RewriteCond %{HTTPS} off
# RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301]
RewriteBase /
RewriteRule ^index\.php$ - [L]
# Добавляем кэширование для статических файлов
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
</IfModule>
# Включаем сжатие GZIP
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE image/svg+xml
</IfModule>
# Стандартные правила WordPress
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# Безопасность заголовков
<IfModule mod_headers.c>
# Защита от XSS
Header set X-XSS-Protection "1; mode=block"
# Запрет на встраивание в iframe (защита от кликджекинга)
Header always append X-Frame-Options SAMEORIGIN
# Отключение MIME-типов
Header set X-Content-Type-Options nosniff
# Политика безопасности контента (CSP) - настройте под ваш сайт
# Header set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https:; style-src 'self' 'unsafe-inline' https:; font-src 'self' https: data:; img-src 'self' https: data:;"
# HSTS (только если используете HTTPS)
# Header set Strict-Transport-Security "max-age=31536000; includeSubDomains"
</IfModule>
# END WordPress
# Защита от спама в комментариях (блокировка по рефереру)
<IfModule mod_rewrite.c>
RewriteCond %{HTTP_REFERER} ^.*(semalt\.com|buttons-for-website\.com|sharebutton\.net|soundfrost\.org|savetubevideo\.com|srecorder\.com|softomix\.net|screentoolkit\.com|softomix\.com).*$ [NC]
RewriteRule .* - [F]
</IfModule>