I searched and could not find a solution on the Internet that covers any number of domains. The use case for me is that I work on localhost, and so the first line (with example.com) will not work on both localhost and my domain, as well as any other name that someone uses instead localhost.
To add an answer to @philfreo, therefore: (copy lines, but change only the first)
# Make sure hostname is lowercase only (or an IP address) RewriteCond %{HTTP_HOST} !^(.+\.)?(.+)?$ RewriteCond %{HTTP_HOST} !^[\d\.]{7,15}$ RewriteRule ^(.*)$ ${lowercase:%{HTTP_HOST}}/$1 [R=301,L]
Reperts to Filfreo! A lot of time was saved with his answer.
Paragon
source share