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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -