How to redirect a domain name to an existing .htaccess URL, DNS records, what else?

I am much more a programmer than a server guru, so any help is greatly appreciated!

Domain name redirection for SEO reasons →
NewDomain.com, hosted with a third party, should point to the current hosted site CurrentDomain.com. I know what I need ...

1) Adjust NewDomain.com DNS. Entries specifically

  • WWW.
  • @.
  • *.
  • FTP
  • mail.

2) Adjust DNS MX records of NewDomain.com

3) Add 301 Redirect to the .htaccess file hosted on CurrentDomain.com so that all requests for NewDomain are redirected to CurrentDomain.com.

RewriteEngine On
RewriteCond %{HTTP_HOST} NewDomain.com$
RewriteRule ^(.*)$ http://CurrentDomain.com/$1 [R=301,L]

:
?
1) - ?
2) DNS? , ?
3) MX mail.CurrentDomain.com, NewDomain?
4) .htaccess?

+3
1

.htaccess , :

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]

, newdomain.com www.newdomain.com 301 .

[NC]

+5

All Articles