Nginx 301 redirect old domain to the single homepage on a new domain -
i'm trying redirect multiple url on old domain single page on new one.
old-domain.com/one old-domain.com/query?=two old-domain.com/one/cat+mouse
should redirect new-domain.com/
using following, redirects whole path, not homepage:
server { listen 80; server_name old-domain.com; return 301 http://new-domain.com; }
if need redirect domain, you'll need
return 301 $scheme://new-domain.com$request_uri;
if need redirect new home, try
server { listen 80; location / { return 301 $scheme://new-domain.com/; } }
Comments
Post a Comment