Добрый день!
Помогите мне пожалуйста.
Есть у меня сайт medical-cabinet.ru
Задалась я целью убрать дубли страниц, либо сделать все со слешами на конце либо без.
На данный момент рассмотрим ситуацию со слешами на конце.
Все успешно получилось. НО... возникли другие проблемы.
1. Перестал работать поиск с любых страниц кроме главной.
Прикладываю htaccess
Вообще он у меня был больше, это так сказать рабочая версия без всяких сжатий и прочего с целью убрать дубли и ничего не сломать.
RewriteEngine On
RewriteBase /
AddDefaultCharset UTF-8
#делаем исключение для поиска чтоб он таки работал
RewriteCond %{HTTP_HOST} ^www.medical-cabinet.ru/$1/$
RewriteCond %{REQUEST_URI} (component/search/?searchword.*)$
RewriteRule ^(.*[^/])$ $1 [L,R=301]
# добавить завершающий слеш, писать L нельзя иначе до правила с поиском не дойдем
RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_URI} ! (/component/search/.*)/$
#RewriteCond %{REQUEST_URI} ! (/administrator)/$
RewriteCond %{HTTP_HOST} (.*)
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*[^/])$ $1/ [L,R=301]
# удалить заверщающий слеш
#RewriteCond %{HTTP_HOST} !(
www.medical-cabinet.ru/administrator/)
#RewriteCond %{HTTP_HOST} (.*)
#RewriteCond %{REQUEST_URI} /$ [NC]
#RewriteRule ^(.*)(/)$ $1 [L,R=301]
#делаем исключение для поиска чтоб он таки работал
##RewriteCond %{REQUEST_URI} (component/search.*)/$
##RewriteRule ^(.*)(/)$ $1 [L,R=301]
RewriteCond %{HTTP_HOST} ^www.medical-cabinet.ru
RewriteRule (.*)
http://medical-cabinet.ru/$1 [R=301,L]
#RewriteCond %{REQUEST_URI} (component/search.*)/$
#RewriteCond %{HTTP_HOST} ^www.medical-cabinet.ru/$1/$
#RewriteRule (.*)
http://medical-cabinet.ru/$1 [R=301,L]
## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
#RewriteCond %{REQUEST_URI} ! /component/aicontactsafe|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.
# перенаправление для sitemap
RewriteRule ^sitemap\.xml$
http://medical-cabinet.ru/index.php?option=com_xmap&id=1&view=xml [R=301,L]
#сжатие CSS
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/css
<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>