<?php
/* Smarty version 4.5.2, created on 2024-08-14 11:31:04
  from '/home/life/public_html/teg.lifestyle.uz/admin/templates/htaccess.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.2',
  'unifunc' => 'content_66bc9578600fa9_85305955',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '52bcf8c7648af42b4bea4f5e24f0a82dc9d20876' => 
    array (
      0 => '/home/life/public_html/teg.lifestyle.uz/admin/templates/htaccess.tpl',
      1 => 1723635011,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_66bc9578600fa9_85305955 (Smarty_Internal_Template $_smarty_tpl) {
?><IfModule mod_autoindex>
	Options -Indexes
</IfModule>

<?php if ($_smarty_tpl->tpl_vars['config']->value['mod_deflate']) {?>
# Gzip сжатие / поддерживается не на всех хостингах
<IfModule mod_deflate.c>
	# Compress HTML, CSS, JavaScript, Text, XML and fonts
	AddOutputFilterByType DEFLATE application/javascript
	AddOutputFilterByType DEFLATE application/rss+xml
	AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
	AddOutputFilterByType DEFLATE application/x-font
	AddOutputFilterByType DEFLATE application/x-font-opentype
	AddOutputFilterByType DEFLATE application/x-font-otf
	AddOutputFilterByType DEFLATE application/x-font-truetype
	AddOutputFilterByType DEFLATE application/x-font-ttf
	AddOutputFilterByType DEFLATE application/x-javascript
	AddOutputFilterByType DEFLATE application/xhtml+xml
	AddOutputFilterByType DEFLATE application/xml
	AddOutputFilterByType DEFLATE font/opentype
	AddOutputFilterByType DEFLATE font/otf
	AddOutputFilterByType DEFLATE font/ttf
	AddOutputFilterByType DEFLATE image/svg+xml
	AddOutputFilterByType DEFLATE image/x-icon
	AddOutputFilterByType DEFLATE text/css
	AddOutputFilterByType DEFLATE text/html
	AddOutputFilterByType DEFLATE text/javascript
	AddOutputFilterByType DEFLATE text/plain
	AddOutputFilterByType DEFLATE text/xml

	# Remove browser bugs (only needed for really old browsers)
	<ifmodule mod_setenvif.c>
		BrowserMatch ^Mozilla/4 gzip-only-text/html
		BrowserMatch ^Mozilla/4\.0[678] no-gzip
		BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
	</ifmodule>
</IfModule>
<?php }?>

<?php if ($_smarty_tpl->tpl_vars['config']->value['mod_headers']) {?>
<ifModule mod_headers.c>
	# Все html и htm файлы будут храниться в кэше браузера один день
	<FilesMatch "\.(html|htm)$">
		Header set Cache-Control "max-age=43200"
	</FilesMatch>
	# Все css, javascript и текстовые файлы будут храниться в кэше браузера одну неделю
	<FilesMatch "\.(js|css|txt)$">
		Header set Cache-Control "max-age=604800"
	</FilesMatch>
	# Все флэш файлы и изображения будут храниться в кэше браузера один месяц
	<FilesMatch "\.(flv|swf|ico|gif|jpg|jpeg|png)$">
		Header set Cache-Control "max-age=43200"
	</FilesMatch>
	# Отключаем кеширование php и других служебных файлов
	<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
	Header unset Cache-Control
	</FilesMatch>
</IfModule>
<?php }?>

<?php if ($_smarty_tpl->tpl_vars['config']->value['mod_expires']) {?>
# Кэширование / поддерживается не на всех хостингах
<ifmodule mod_expires.c>
	<filesmatch "\.(jpg|jpeg|png|gif|js|css|swf|ico|woff|mp3)$">
	ExpiresActive on
	ExpiresDefault "access plus 7 days"
	</filesmatch>
</ifmodule>
<?php }?>

# Google PageSpeed Insights модуль PageSpeed,есть не на всех хостингах и не везде может работать, нужно уточнять у хостеров
<IfModule pagespeed_module>
	ModPagespeed on
	ModPagespeedRewriteLevel CoreFilters
	ModPagespeedEnableFilters make_google_analytics_async
	ModPagespeedEnableFilters prioritize_critical_css
	ModPagespeedEnableFilters defer_javascript
	ModPagespeedEnableFilters sprite_images
	ModPagespeedEnableFilters convert_png_to_jpeg,convert_jpeg_to_webp
	ModPagespeedEnableFilters collapse_whitespace,remove_comments
</IfModule>

<?php if ($_smarty_tpl->tpl_vars['homePageId']->value) {?>
DirectoryIndex /public/section.php?sectionId=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['homePageId']->value, ENT_QUOTES, 'UTF-8', true);?>
&rewrite=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['rewrite']->value, ENT_QUOTES, 'UTF-8', true);?>

<?php }?>
RewriteEngine On


SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1


<?php if ($_smarty_tpl->tpl_vars['config']->value['www_redirect'] == 1) {?>
	# match any URL with www and rewrite it to https without the www
	RewriteCond %{HTTP_HOST} ^(www\.)(.*) [NC]
	RewriteRule (.*) https://%2%{REQUEST_URI} [L,R=301]
<?php }?>

<?php if (IS_HTTPS || $_smarty_tpl->tpl_vars['config']->value['http_redirect'] == 1) {?>
	RewriteCond %{HTTPS} =off
	<?php if ($_smarty_tpl->tpl_vars['config']->value['www_redirect'] == 1) {?>
		# match urls that are non https (without the www)
		RewriteCond %{HTTP_HOST} !^(www\.)(.*) [NC]
	<?php }?>
	RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L]
<?php } elseif ($_smarty_tpl->tpl_vars['config']->value['http_redirect'] == 2) {?>
	RewriteCond %{HTTPS} =on [OR]
	RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [QSA,L]
<?php }?>

ErrorDocument 404 /public/error-404.php?rewrite=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['rewrite']->value, ENT_QUOTES, 'UTF-8', true);?>


<?php if ($_smarty_tpl->tpl_vars['config']->value['compress_js_css']) {?>
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.+\.(css|js))$ /compress.php?path=$1&rewrite=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['rewrite']->value, ENT_QUOTES, 'UTF-8', true);?>
 [L]
<?php }?>

RewriteRule ^rss.xml$ /public/rss.php?rewrite=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['rewrite']->value, ENT_QUOTES, 'UTF-8', true);?>
 [L]
RewriteRule ^sitemap.xml$ /public/sitemap.php?rewrite=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['rewrite']->value, ENT_QUOTES, 'UTF-8', true);?>
 [L]

<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['SECTIONS']->value, 'section');
$_smarty_tpl->tpl_vars['section']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['section']->value) {
$_smarty_tpl->tpl_vars['section']->do_else = false;
if ($_smarty_tpl->tpl_vars['section']->value['type'] == "plain") {
if ($_smarty_tpl->tpl_vars['section']->value['fileName'] == "index") {?>
RewriteRule ^<?php echo htmlspecialchars((string)preg_quote($_smarty_tpl->tpl_vars['section']->value['dir']), ENT_QUOTES, 'UTF-8', true);?>
\.<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['config']->value['file_extension'], ENT_QUOTES, 'UTF-8', true);?>
$ <?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['SITE_URL']->value, ENT_QUOTES, 'UTF-8', true);?>
/ [L,R=301]
<?php } else { ?>
RewriteRule ^<?php echo htmlspecialchars((string)preg_quote($_smarty_tpl->tpl_vars['section']->value['dir']), ENT_QUOTES, 'UTF-8', true);?>
\.<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['config']->value['file_extension'], ENT_QUOTES, 'UTF-8', true);?>
$ /public/section.php?sectionId=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['section']->value['sectionId'], ENT_QUOTES, 'UTF-8', true);?>
&rewrite=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['rewrite']->value, ENT_QUOTES, 'UTF-8', true);?>
 [L]
<?php }?>

<?php }
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>

#RewriteRule ^brands/([^/]+)/page([0-9]+)\.<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['config']->value['file_extension'], ENT_QUOTES, 'UTF-8', true);?>
$ /public/brand.php?%{QUERY_STRING}&fileName=$1&page=$2&rewrite=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['rewrite']->value, ENT_QUOTES, 'UTF-8', true);?>
 [L]
#RewriteRule ^brands/([^/]+)/([^/]+)/page([0-9]+)\.<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['config']->value['file_extension'], ENT_QUOTES, 'UTF-8', true);?>
$ /public/brand.php?%{QUERY_STRING}&fileName=$1&page=$2&rewrite=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['rewrite']->value, ENT_QUOTES, 'UTF-8', true);?>
 [L]
#RewriteRule ^brands/([^/]+)/([^/]+) /public/brand.php?%{QUERY_STRING}&fileName=$1&param=$2&rewrite=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['rewrite']->value, ENT_QUOTES, 'UTF-8', true);?>
 [L]
#RewriteRule ^brands/([^/]+) /public/brand.php?%{QUERY_STRING}&fileName=$1&rewrite=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['rewrite']->value, ENT_QUOTES, 'UTF-8', true);?>
 [L]

<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['SECTIONS']->value, 'section');
$_smarty_tpl->tpl_vars['section']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['section']->value) {
$_smarty_tpl->tpl_vars['section']->do_else = false;
if ($_smarty_tpl->tpl_vars['section']->value['type'] == "tree") {?>

RewriteRule ^<?php echo htmlspecialchars((string)preg_quote($_smarty_tpl->tpl_vars['section']->value['dir']), ENT_QUOTES, 'UTF-8', true);?>
$ <?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['section']->value['path'], ENT_QUOTES, 'UTF-8', true);?>
/ [L,R=301]
RewriteRule ^<?php echo htmlspecialchars((string)preg_quote($_smarty_tpl->tpl_vars['section']->value['dir']), ENT_QUOTES, 'UTF-8', true);?>
/$ /public/section.php?%{QUERY_STRING}&sectionId=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['section']->value['sectionId'], ENT_QUOTES, 'UTF-8', true);?>
&rewrite=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['rewrite']->value, ENT_QUOTES, 'UTF-8', true);?>
 [L]
RewriteRule ^<?php echo htmlspecialchars((string)preg_quote($_smarty_tpl->tpl_vars['section']->value['dir']), ENT_QUOTES, 'UTF-8', true);?>
/page([0-9]+)\.<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['config']->value['file_extension'], ENT_QUOTES, 'UTF-8', true);?>
$ /public/section.php?%{QUERY_STRING}&sectionId=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['section']->value['sectionId'], ENT_QUOTES, 'UTF-8', true);?>
&page=$1&rewrite=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['rewrite']->value, ENT_QUOTES, 'UTF-8', true);?>
 [L]
<?php if ($_smarty_tpl->tpl_vars['section']->value['typeContent'] == "products") {?>
RewriteRule ^<?php echo htmlspecialchars((string)preg_quote($_smarty_tpl->tpl_vars['section']->value['dir']), ENT_QUOTES, 'UTF-8', true);?>
/([^/]+)\.<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['config']->value['file_extension'], ENT_QUOTES, 'UTF-8', true);?>
$ /public/product.php?%{QUERY_STRING}&fileName=$1&sectionId=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['section']->value['sectionId'], ENT_QUOTES, 'UTF-8', true);?>
&rewrite=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['rewrite']->value, ENT_QUOTES, 'UTF-8', true);?>
 [L]

<?php } elseif ($_smarty_tpl->tpl_vars['section']->value['typeContent'] == "projects") {?>
RewriteRule ^<?php echo htmlspecialchars((string)preg_quote($_smarty_tpl->tpl_vars['section']->value['dir']), ENT_QUOTES, 'UTF-8', true);?>
/([^/]+)\.<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['config']->value['file_extension'], ENT_QUOTES, 'UTF-8', true);?>
$ /public/project.php?%{QUERY_STRING}&fileName=$1&sectionId=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['section']->value['sectionId'], ENT_QUOTES, 'UTF-8', true);?>
&rewrite=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['rewrite']->value, ENT_QUOTES, 'UTF-8', true);?>
 [L]

<?php } else { ?>
RewriteRule ^<?php echo htmlspecialchars((string)preg_quote($_smarty_tpl->tpl_vars['section']->value['dir']), ENT_QUOTES, 'UTF-8', true);?>
/([^/]+)\.<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['config']->value['file_extension'], ENT_QUOTES, 'UTF-8', true);?>
$ /public/article.php?%{QUERY_STRING}&fileName=$1&sectionId=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['section']->value['sectionId'], ENT_QUOTES, 'UTF-8', true);?>
&rewrite=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['rewrite']->value, ENT_QUOTES, 'UTF-8', true);?>
 [L]

<?php }
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>

# все запросы в префиксом (ajax) будут обрабатываться следующим образом ajax-(что здесь будет) /public/ajax-feedback СЮДА ПРИДЕТ.php
RewriteRule ^ajax-(.*) /public/ajax-$1.php?rewrite=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['rewrite']->value, ENT_QUOTES, 'UTF-8', true);?>
 [QSA]
# все запросы в префиксом (api) будут обрабатываться следующим образом api-(что здесь будет) /public/api-app СЮДА ПРИДЕТ.php
RewriteRule ^api-(.*) /public/api-$1.php?rewrite=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['rewrite']->value, ENT_QUOTES, 'UTF-8', true);?>
 [QSA]

# Set the “ea-php74” package as the default “PHP” programming language.
<IfModule mime_module>
	AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
</IfModule>

<?php }
}
