Слеш после рубрик WordPress + удаление множественных ///
Удаление слешей после html и множественных слешей
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteRule ^(.+\.html)/$ https://%{https_HOST}/$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
Добавление / к рубрикам
либо вставка в function.php
function pcl_smart_trailingslashit($string) { /* ensure, that there is one trailing slash */ $string = rtrim($string, '/') . '/'; /* if there is a filename extension like .html or .php, then remove the trailing slash */ if ( 0 < preg_match("#\.[^/]+/$#", $string) ) { $string = rtrim($string, '/'); } return $string; } add_filter('user_trailingslashit', 'pcl_smart_trailingslashit');
Либо плагином
Иногда не хватает этих настроек и главная все равно с //// на конце
Просто добавляем
RewriteCond %{THE_REQUEST} //
RewriteRule .* /$0 [R=301,L]
Полезные ссылки
https://searchengines.guru/showthread.php?t=1018269&page=10