Skip to content

Instantly share code, notes, and snippets.

@davidohlin
Last active May 8, 2018 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidohlin/22db1aa3449d17c378326e0cb5ae5a52 to your computer and use it in GitHub Desktop.
Save davidohlin/22db1aa3449d17c378326e0cb5ae5a52 to your computer and use it in GitHub Desktop.
Working multisite redirect nginx + bedrock

Working multisite redirect nginx + bedrock

Place the following in the server block of your sites nginx config, ie /etc/nginx/sites-available/example.com

# Multisite
# https://github.com/roots/trellis/blob/master/roles/wordpress-setup/templates/wordpress-site.conf.j2
if (!-e $request_filename) {
    rewrite /wp-admin$ $scheme://$host$uri/ permanent;
    rewrite ^(/[^/]+)?(/wp-.*) /wp$2 last;
    rewrite ^(/[^/]+)?(/.*\.php) /wp$2 last;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment