Is it possible to do a redirect from domain to another domain http https (DIFFERENT domains)?

There are two different domains for one site.
Is it possible to do a redirect from domain to another domain http https (DIFFERENT domains)?
The domain (optional) the http "name .RF", and the second domain (main) https "name.ru". So you can do/make ?
April 3rd 20 at 17:37
2 answers
April 3rd 20 at 17:39
Put the 301 redirect

# example for nginx 
server {
 listen 80 default_server;
 listen [::]:80 default_server;
 server_name _;
 return 301 https://example.org$request_uri;
 # return 301 https://$host$request_uri;
}
April 3rd 20 at 17:41
Of course you can.
The help of Yandex and Google on this issue.

Find more questions by tags Search engine optimizationSearch engines