how to redirect the domain to another domain

Posted October 5, 2016 9.1k views
Server Optimization

I have domain to your host
and has the domain http: //xn–c1aabfob6cfv0g.xn–p1ai/ on another host. I need to make a redirect from at http: //xn–c1aabfob6cfv0g.xn–p1ai/ how do I do this on your host?

p.s. I almost know nothing about this, please write in detail. Thank you

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.

5 answers

what are you use LAMP OR LEMP !!!

server_name supports suffix matches using syntax:

server {
  rewrite ^ http://www.xn--c1aabfob6cfv0g.xn--p1ai$request_uri? permanent;
server { server_name;return 302 $scheme://;}

Just create a very simple VirtualHost for the old domain in which you redirect it to the new domain:

<VirtualHost *:80>
    RedirectPermanent /
    # optionally add an AccessLog directive for
    # logging the requests and do some statistics

or on any version 0.9.1 or higher:

server {
  return 301$request_uri;
Submit an Answer