Is it possible to use a .htaccess file to redirect mydomain.com to mydomain.com/
I tried:
RewriteRule ^(.*)/$ http://%{HTTP_HOST}/$1
which should work for any URL on the domain however it only works for non-root URLs (Above code removes trailing slash rather than adds it, however I wanted to see if it'd work for root URLs).
There was also the solution from here which is:
RewriteCond %{THE_REQUEST} ^([A-Z]{3,9})\ (.*)//([^\ ]*)
RewriteRule ^ %2/%3 [R=301,L]
This removes multiple trailing slashes (ie mydomain.com// becomes mydomain.com/) but still doesn't work for mydomain.com -> mydomain.com/
I'd even accept a way to do it with PHP if that's available.