I am trying to redirect all URLs to lowercase and remove trailing slashes.
My htaccess file currently looks like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond expr "tolower(%{REQUEST_URI}) =~ /(.*)/"
RewriteRule [A-Z] %1 [R=308,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [R=308,L]
</IfModule>
This does work, however it does two redirects one after another. First redirect forces lowercase and the second redirect removes the trailing slash.
How can I merge these two rules into one redirect?