How to Forward Domain Name to Existing URL - .htaccess, DNS records, what else?
snippet in htaccess

How to Forward Domain Name to Existing URL - .htaccess, DNS records, what else?

user3012

Options +FollowSymlinks -MultiViews
RewriteEngine on

# for http
RewriteCond %{HTTP_HOST} ^(www\.)?newdomain\.com$ [NC]
RewriteCond %{SERVER_PORT} =80
RewriteRule ^(.*)$ http://CurrentDomain.com/$1 [R=301,L]

# for https
RewriteCond %{HTTP_HOST} ^(www\.)?newdomain\.com$ [NC]
RewriteCond %{SERVER_PORT} =443
RewriteRule ^(.*)$ https://CurrentDomain.com/$1 [R=301,L]