Суть проблемы следующая. Настраиваю 301 редирект и сжатие на сайте. Использую все как обычно и на других сайтах, но сейчас столкнулся с тем, что .htaccess не реагирует на условие связанное со слешом или без.
Пробовал все варианты, что нашел в сети. (к примеру:
web-optimizator.com/301-redirekt-htaccess/).
Все работает, но вот на слеш никакой реакции....
Вот мой htaccess
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# 301 редирект со страниц со слешем на без слеша
RewriteCond %{REQUEST_URI} !\?
RewriteCond %{REQUEST_URI} !\&
RewriteCond %{REQUEST_URI} !\=
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_URI} ![^\/]$
RewriteRule ^(.*)\/$ /$1 [R=301,L]
# Редирект c www на без www
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
# Http to https
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
# 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)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Header append Vary User-Agent
</IfModule>
<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=2592000"
</FilesMatch>
#отключить кэширование
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</FilesMatch>
</IfModule>
#<IfModule mod_expires.c>
# ExpiresActive On
# # Set default expires to 2 days
# ExpiresDefault A172800
# ExpiresByType text/css A31536000
# ExpiresByType application/x-javascript A31536000
# ExpiresByType text/x-component A31536000
# ExpiresByType text/html A3600
# ExpiresByType text/richtext A3600
# ExpiresByType image/svg+xml A3600
# ExpiresByType text/plain A3600
# ExpiresByType text/xsd A3600
# ExpiresByType text/xsl A3600
# ExpiresByType text/xml A3600
# ExpiresByType video/asf A31536000
# ExpiresByType video/avi A31536000
# ExpiresByType image/bmp A31536000
# ExpiresByType application/java A31536000
# ExpiresByType video/divx A31536000
# ExpiresByType application/msword A31536000
# ExpiresByType application/vnd.ms-fontobject A31536000
# ExpiresByType application/x-msdownload A31536000
# ExpiresByType image/gif A31536000
# ExpiresByType application/x-gzip A31536000
# ExpiresByType image/x-icon A31536000
# ExpiresByType image/jpeg A31536000
# ExpiresByType application/vnd.ms-access A31536000
# ExpiresByType audio/midi A31536000
# ExpiresByType video/quicktime A31536000
# ExpiresByType audio/mpeg A31536000
# ExpiresByType video/mp4 A31536000
# ExpiresByType video/mpeg A31536000
# ExpiresByType application/vnd.ms-project A31536000
# ExpiresByType application/x-font-otf A31536000
# ExpiresByType application/vnd.oasis.opendocument.database A31536000
# ExpiresByType application/vnd.oasis.opendocument.chart A31536000
# ExpiresByType application/vnd.oasis.opendocument.formula A31536000
# ExpiresByType application/vnd.oasis.opendocument.graphics A31536000
# ExpiresByType application/vnd.oasis.opendocument.presentation A31536000
# ExpiresByType application/vnd.oasis.opendocument.spreadsheet A31536000
# ExpiresByType application/vnd.oasis.opendocument.text A31536000
# ExpiresByType audio/ogg A31536000
# ExpiresByType application/pdf A31536000
# ExpiresByType image/png A31536000
# ExpiresByType application/vnd.ms-powerpoint A31536000
# ExpiresByType audio/x-realaudio A31536000
# ExpiresByType image/svg+xml A31536000
# ExpiresByType application/x-shockwave-flash A31536000
# ExpiresByType application/x-tar A31536000
# ExpiresByType image/tiff A31536000
# ExpiresByType application/x-font-ttf A31536000
# ExpiresByType audio/wav A31536000
# ExpiresByType audio/wma A31536000
# ExpiresByType application/vnd.ms-write A31536000
# ExpiresByType application/vnd.ms-excel A31536000
# ExpiresByType application/zip A31536000
#</IfModule>