default_charset utf-8
php_flag register_globals off
php_flag session.use_trans_sid off
php_value display_errors on
php_value mbstring.internal_encoding UTF-8
php_value mbstring.func_overload 2
php_value max_input_vars 10000
php_value short_open_tag On
php_value max_execution_time 600
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
# Переадресация с второстепенных доменов
RewriteCond %{HTTP_HOST} !^mysite\.ru(.*)$ [NC]
RewriteRule ^(.*)$ https://mysite.ru/$1 [R=301,L]
# SSL
RewriteCond %{REQUEST_FILENAME} !^(.*)/bitrix/services/ymarket(.*)$
RewriteCond %{REQUEST_FILENAME} !^(.*)/bitrix/admin/1c_exchange\.php$
RewriteCond %{SERVER_PORT} !^443$
#RewriteCond %{HTTPS} off
#RewriteCond %{HTTP:X-Forwarded-Scheme} !=https
RewriteRule ^(.*)$ https://mysite.ru/$1 [R=301,L]
# Переадресация с добавлением / в конце
RewriteCond %{REQUEST_FILENAME} !^(.*)/bitrix/services/ymarket(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^.]+)(?<!/)$ /$1/ [R=301,L]
# Переадресация с index.php на /
RewriteCond %{REQUEST_FILENAME} ^(.*)/index\.php$
RewriteRule ^(.*)index\.php(.*)$ /$1$2 [R=301,L]
# Безопасность
RewriteRule ^composer\.(json|lock)$ / [R=404,L]
RewriteRule ^vendor(.*)$ / [R=404,L]
RewriteRule ^(.*)\.(idea|git|gitmodules|gitignore|htaccess|vagrant)(.*)$ / [R=404,L]
RewriteRule ^deploy-config\.json$ / [R=404,L]
# Bitrix
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
Спасибо!
Обсуждают сегодня