Tell me how to implement it? Clambered all Google, not a single solution helped. I also saw the answer here:

RewriteCond %{REQUEST_URI} !/$ RewriteCond %{REQUEST_URI} !\. RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L] 

Also to no avail.

Whole .htaccess:

 #задаем кодировку сайта AddDefaultCharset UTF-8 # Следовать за символическими ссылками или нет(симлинки) # Options +SymLinksIfOwnerMatch Options +FollowSymLinks # Запрет выдачи листинга пустого каталога Options -Indexes # По умолчанию файлы DirectoryIndex index.php index.html # перенаправляем дубль главной страницы модуля page/homepage Redirect 301 /page/homepage / # Включаем механизма преобразования RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt|assets|sitemap\.xml) RewriteCond %{REQUEST_URI} !\.(css¦js¦jpg¦gif)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 [L,QSA] # Что бы перенаправить пользователей на сайт с WWW префиксом # # RewriteCond %{HTTP_HOST} ^example\.com\.ua$ [NC] # RewriteRule ^(.*)$ "тут ссылка на сайт"$1 [R=301,L] # # Что бы перенаправить пользователей на сайт без WWW префикса # RewriteCond %{HTTP_HOST} ^www\.example\.ru$ [NC] RewriteRule ^(.*)$ "ссылка на сайт/"$1 [R=301,L] #в случае index.php: RewriteCond %{THE_REQUEST} ^[AZ]{3,9}\ /index\.php\ HTTP/ RewriteRule ^index\.php$ "ссылка на сайт/" [R=301,L] 

'

  • Well, if it did not help, show ALL .htaccess of your own (right in the question). - VenZell
  • threw off the full htaccess - Evgeny Guba

1 answer 1

Try this code in .htaccess in the root of the site:

 RewriteEngine On RewriteCond %{REQUEST_URI} ^(.+)/$ RewriteRule .* http://%{HTTP_HOST}%1 [R=301,L,QSA] 
  • Visman, thanks for the answer, in your case removes the slash at the end, but adds index.php - it was: site.ru/pppp/catalog/product , after converting ' site.ru/index.php/pppp/catalog/product '. - Yevgeny Guba
  • @ YevgenyGuba, but I didn’t write RewriteEngine On for nothing in the first line? Immediately after this command, it is necessary to put the second and third lines! - Visman
  • No, of course not in vain. then correct me if I'm wrong - "RewriteEngine On" - includes a conversion mechanism and, as I understood it, you need to use it only 1 time in the document. higher in my question, I threw off the full version of my htaccess and there is already a "RewriteEngine On" there - Eugene Guba
  • @ YevgenyGuba, in my comments it is written: Сразу после этой команды вторую и третью строки ставить надо! - 2 and 3 line here: RewriteCond %{REQUEST_URI} ^(.+)/$ And RewriteRule .* http://%{HTTP_HOST}%1 [R=301,L,QSA] Put these lines after your RewriteEngine On and before all your rules. - Visman
  • Thank you for your assistance - it worked. The last question, since you are a person who knows - can you recommend a resource, where you can get acquainted yourself more closely with the regular expression syntax? - Yevgeny Guba