Htaccess: add/remove trailing slash from URL
Right below the RewriteEngine On line, add: RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R] # <- for test, for prod use [L,R=301] to enforce a no-trailing-slash policy. To enforce a trailing-slash policy: RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*[^/])$ /$1/ [L,R] # <- for test, for prod use [L,R=301] EDIT: commented the R=301 parts because, as explained … Read more