Стандартный .htaccess — различия между версиями
Материал из Umicms
Vitaliks (обсуждение | вклад) |
Kovach (обсуждение | вклад) |
||
Строка 1: | Строка 1: | ||
− | '''Актуально для версии | + | '''Актуально для версии 21.''' |
[[category:.htaccess]][[Категория:Вопросы установки настройки и переноса]] | [[category:.htaccess]][[Категория:Вопросы установки настройки и переноса]] | ||
<source lang="apache"> | <source lang="apache"> | ||
− | + | <IfModule mod_negotiation.c> | |
− | + | Options All -Indexes | |
− | + | </IfModule> | |
− | |||
− | + | <IfModule mod_rewrite.c> | |
+ | RewriteEngine On | ||
− | RewriteCond %{REQUEST_FILENAME} -f | + | RewriteCond %{REQUEST_FILENAME} !-f |
− | RewriteRule ^( | + | RewriteRule ^(.*)$ index.php?path=$1&%{QUERY_STRING}&umi_authorization=%{HTTP:Authorization} [L] |
− | RewriteCond %{REQUEST_FILENAME} | + | RewriteCond %{REQUEST_FILENAME} -f |
− | RewriteRule ^ | + | RewriteRule ^(developerTools|errors|libs|smt|cache|xmldb|static|packages)\/.*$ / [L,R] #legacy directories |
+ | </IfModule> | ||
− | + | <IfModule mod_php7.c> | |
− | + | php_flag engine off | |
+ | </IfModule> | ||
− | + | <IfModule mod_php5.c> | |
− | + | php_flag engine off | |
+ | </IfModule> | ||
− | + | <IfModule mod_access_compat.c> | |
− | + | <FilesMatch "(?i)\.(php[2-5]?|cgi|pl|fcgi|fpl|phtm|phtml|shtml|asp|jsp|twig|tpl|xslt?|git|svn|htaccess|htaccess_old|htpasswd|gitignore|gitkeep|ini|log|conf|md|sql|lock|umi\.json)$"> | |
− | + | Deny from all | |
− | + | </FilesMatch> | |
− | |||
− | |||
− | |||
− | + | <FilesMatch "^(?i)(index|install|umi_smt|installer|dummy|smu/installer|autothumbs|captcha|counter|cron|go-out|license_restore|save_domain_keycode|session|static_banner|updater)\.php$"> | |
− | + | Allow from all | |
− | + | </FilesMatch> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | <FilesMatch "^(?i)(index|install|umi_smt|installer|dummy|smu/installer)\.php$"> | |
− | + | <IfModule mod_php7.c> | |
+ | php_flag engine on | ||
+ | </IfModule> | ||
− | + | <IfModule mod_php5.c> | |
+ | php_flag engine on | ||
+ | </IfModule> | ||
+ | </FilesMatch> | ||
+ | </IfModule> | ||
− | + | <IfModule mod_authz_core.c> | |
− | + | <IfModule !mod_access_compat.c> | |
+ | <FilesMatch "(?i)\.(php[2-5]?|cgi|pl|fcgi|fpl|phtm|phtml|shtml|asp|jsp|twig|tpl|xslt?|git|svn|htaccess|htaccess_old|htpasswd|gitignore|gitkeep|ini|log|conf|md|sql|lock|umi\.json)$"> | ||
+ | Deny from all | ||
+ | </FilesMatch> | ||
− | + | <FilesMatch "^(?i)(index|install|umi_smt|installer|dummy|smu/installer|autothumbs|captcha|counter|cron|go-out|license_restore|save_domain_keycode|session|static_banner|updater)\.php$"> | |
− | + | Allow from all | |
− | + | </FilesMatch> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | <FilesMatch "^(?i)(index|install|umi_smt|installer|dummy|smu/installer)\.php$"> | |
− | + | <IfModule mod_php7.c> | |
− | + | php_flag engine on | |
− | + | </IfModule> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | <IfModule mod_php5.c> | |
− | + | php_flag engine on | |
− | + | </IfModule> | |
+ | </FilesMatch> | ||
+ | </IfModule> | ||
+ | </IfModule> | ||
+ | <IfModule !mod_authz_core.c> | ||
+ | <IfModule !mod_access_compat.c> | ||
+ | <FilesMatch "(?i)\.(php[2-5]?|cgi|pl|fcgi|fpl|phtm|phtml|shtml|asp|jsp|twig|tpl|xslt?|git|svn|htaccess|htaccess_old|htpasswd|gitignore|gitkeep|ini|log|conf|md|sql|lock|umi\.json)$"> | ||
+ | Deny from all | ||
+ | </FilesMatch> | ||
− | + | <FilesMatch "^(?i)(index|install|umi_smt|installer|dummy|smu/installer|autothumbs|captcha|counter|cron|go-out|license_restore|save_domain_keycode|session|static_banner|updater)\.php$"> | |
− | + | Allow from all | |
− | + | </FilesMatch> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | <FilesMatch "^(?i)(index|install|umi_smt|installer|dummy|smu/installer)\.php$"> | |
+ | <IfModule mod_php7.c> | ||
+ | php_flag engine on | ||
+ | </IfModule> | ||
− | + | <IfModule mod_php5.c> | |
− | + | php_flag engine on | |
− | + | </IfModule> | |
− | <IfModule | + | </FilesMatch> |
− | + | </IfModule> | |
− | |||
− | </ | ||
− | |||
− | <IfModule | ||
− | |||
</IfModule> | </IfModule> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</source> | </source> |
Текущая версия на 08:14, 21 января 2020
Актуально для версии 21.
<IfModule mod_negotiation.c>
Options All -Indexes
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?path=$1&%{QUERY_STRING}&umi_authorization=%{HTTP:Authorization} [L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(developerTools|errors|libs|smt|cache|xmldb|static|packages)\/.*$ / [L,R] #legacy directories
</IfModule>
<IfModule mod_php7.c>
php_flag engine off
</IfModule>
<IfModule mod_php5.c>
php_flag engine off
</IfModule>
<IfModule mod_access_compat.c>
<FilesMatch "(?i)\.(php[2-5]?|cgi|pl|fcgi|fpl|phtm|phtml|shtml|asp|jsp|twig|tpl|xslt?|git|svn|htaccess|htaccess_old|htpasswd|gitignore|gitkeep|ini|log|conf|md|sql|lock|umi\.json)$">
Deny from all
</FilesMatch>
<FilesMatch "^(?i)(index|install|umi_smt|installer|dummy|smu/installer|autothumbs|captcha|counter|cron|go-out|license_restore|save_domain_keycode|session|static_banner|updater)\.php$">
Allow from all
</FilesMatch>
<FilesMatch "^(?i)(index|install|umi_smt|installer|dummy|smu/installer)\.php$">
<IfModule mod_php7.c>
php_flag engine on
</IfModule>
<IfModule mod_php5.c>
php_flag engine on
</IfModule>
</FilesMatch>
</IfModule>
<IfModule mod_authz_core.c>
<IfModule !mod_access_compat.c>
<FilesMatch "(?i)\.(php[2-5]?|cgi|pl|fcgi|fpl|phtm|phtml|shtml|asp|jsp|twig|tpl|xslt?|git|svn|htaccess|htaccess_old|htpasswd|gitignore|gitkeep|ini|log|conf|md|sql|lock|umi\.json)$">
Deny from all
</FilesMatch>
<FilesMatch "^(?i)(index|install|umi_smt|installer|dummy|smu/installer|autothumbs|captcha|counter|cron|go-out|license_restore|save_domain_keycode|session|static_banner|updater)\.php$">
Allow from all
</FilesMatch>
<FilesMatch "^(?i)(index|install|umi_smt|installer|dummy|smu/installer)\.php$">
<IfModule mod_php7.c>
php_flag engine on
</IfModule>
<IfModule mod_php5.c>
php_flag engine on
</IfModule>
</FilesMatch>
</IfModule>
</IfModule>
<IfModule !mod_authz_core.c>
<IfModule !mod_access_compat.c>
<FilesMatch "(?i)\.(php[2-5]?|cgi|pl|fcgi|fpl|phtm|phtml|shtml|asp|jsp|twig|tpl|xslt?|git|svn|htaccess|htaccess_old|htpasswd|gitignore|gitkeep|ini|log|conf|md|sql|lock|umi\.json)$">
Deny from all
</FilesMatch>
<FilesMatch "^(?i)(index|install|umi_smt|installer|dummy|smu/installer|autothumbs|captcha|counter|cron|go-out|license_restore|save_domain_keycode|session|static_banner|updater)\.php$">
Allow from all
</FilesMatch>
<FilesMatch "^(?i)(index|install|umi_smt|installer|dummy|smu/installer)\.php$">
<IfModule mod_php7.c>
php_flag engine on
</IfModule>
<IfModule mod_php5.c>
php_flag engine on
</IfModule>
</FilesMatch>
</IfModule>
</IfModule>