Skip to content

Instantly share code, notes, and snippets.

@TheLastCicada
Created January 28, 2013 23:52
Show Gist options
  • Save TheLastCicada/4660430 to your computer and use it in GitHub Desktop.
Save TheLastCicada/4660430 to your computer and use it in GitHub Desktop.
# This order might seem weird - this is attempted to match last if rules below fail.
# http://wiki.nginx.org/HttpCoreModule
location / {
try_files $uri $uri/ /index.php?$args;
index index.html index.htm index.php;
# WordPress multisite files rule
rewrite .*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;
if (!-e $request_filename) {
rewrite ^.+/?(/wp-.*) $1 last;
rewrite ^.+/?(/.*\.php)$ $1 last;
rewrite ^(.+)$ /index.php last;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment