Skip to content

Instantly share code, notes, and snippets.

@matteocrippa
Created April 26, 2013 09:18
Show Gist options
  • Select an option

  • Save matteocrippa/5465999 to your computer and use it in GitHub Desktop.

Select an option

Save matteocrippa/5465999 to your computer and use it in GitHub Desktop.
Nginx - Redirect a domain with 301 to another domain
server {
# set the domain name this rule will work for
server_name tld.domain.ext;
# i force to listen to port 80
listen 80;
# no root, directly the redirect
rewrite ^ http://www.newdomain.com$request_uri? permanent;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment