0

Basically that, I have example.com/ but if I visit example.com// or with more slashes I would like to remove the extra ones and just leave one of them.

I found this but it's not working, I added on the .htaccess file.

<IfModule mod_rewrite.c>
    RewriteBase /
    RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$
    RewriteRule (.*) %1/%2 [R=301,L]
</IfModule>

Keep in mind I used the homepage as an example, but it can happen on any page, adding extra slashes doesn't break the page but I need to be able to remove them so the user only sees one / at the end.

Castiblanco
  • 1,170
  • 4
  • 12
  • 32
  • Make sure you are putting this rule near the top of your `.htaccess` file, _before_ the WordPress code block (ie. _before_ `# BEGIN WordPress`). – MrWhite May 26 '22 at 23:53

0 Answers0