Redirect from french domain to english domain

I have two domains - lets call them and - running on a Nginx server.

When users visit, I want them to be redirected to

A /cname records? Or nginx redirects? Not sure how best to achieve this.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This would be done by entering a server listener in Nginx, redirecting the domain on the server. You need to have a DNS A-record point to the same Nginx web-server’s IP-adress, as you normally would if was in use. Then add this to the config:

server {
        return 301 $scheme://;

HTML status code 301 tells Nginx that the page/site has moved, and redirects the user to the given URL. If you would want to replicate everything that the user has written after the domain name, for instance, using the “/news.html”-part in the new redirected URL, use it like this:

server {
        return 301 $scheme://$request_uri;