I have hosted multiple websites on my server all sharing the same code base having one htaccess.
I need something like this.
if (domainname != example.com) redirect to example.com
if there any way of handling this from htaccess
used the following but still it is not working
RewriteCond !^(.*)$ https://example1.com/$1 [NC]
RewriteRule ^(.*)$ https://example2.com/$1 [R=301,NC,L]