RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain1.com
RewriteCond %{HTTP_HOST} ^mydomain2.com
RewriteCond %{HTTP_HOST} ^mydomain3.com
RewriteCond %{HTTP_HOST} ^mydomain4.com
RewriteCond %{HTTP_HOST} ^mydomain5.com
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=permanent,L]
This will redirect all your 18 domains to your to your new single domain www.newdomain.com Otherwise you can use following code to redirect each domain if they are on separate hosting
RewriteCond %{HTTP_HOST} ^mydomain.com
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=permanent,L]
RewriteCond %{HTTP_HOST} ^mydomain1.com
RewriteCond %{HTTP_HOST} ^mydomain2.com
RewriteCond %{HTTP_HOST} ^mydomain3.com
RewriteCond %{HTTP_HOST} ^mydomain4.com
RewriteCond %{HTTP_HOST} ^mydomain5.com
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=permanent,L]
This will redirect all your 18 domains to your to your new single domain www.newdomain.com Otherwise you can use following code to redirect each domain if they are on separate hosting
RewriteCond %{HTTP_HOST} ^mydomain.com
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=permanent,L]
.htaccess multiple redirect in domain & Redirect multiple domains to one domain (with or without www before)