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)
Hey Nice blog,Thanks for sharing this blog.!!!
ReplyDeleteBest Embedded system training in lucknow
Best python Summer training
php industrial training in Lucknow
Best Live projects training in Lucknow
B-tech Summer projects training in Lucknow
Thank you for sharing such great information very useful to us.
ReplyDeleteSummer training in Noida