 
RewriteEngine On

# Backward-compatible redirects for old root-level tool pages and directory-style tool URLs.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Za-z0-9-]+)\.html$ /tools/$1.html [R=301,L]

RewriteRule ^tools/([A-Za-z0-9-]+)/?$ /tools/$1.html [R=301,L]
