Skip to content

Instantly share code, notes, and snippets.

@kidpollo
Created July 9, 2010 22:53
Show Gist options
  • Save kidpollo/470210 to your computer and use it in GitHub Desktop.
Save kidpollo/470210 to your computer and use it in GitHub Desktop.
if ($host ~* ^([^.]+\.[^.]+)$) {
set $host_without_subdomain $1;
rewrite ^\/(\w+)(\/.*)$ http://$1.$host_without_subdomain$2 break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment