Nginx WordPress multi-site rewrite rules
There is no .htaccess file in Nginx so instead edit the nginx.conf file located here: /etc/nginx/nginx.conf
In a previous Pro Tip (http://coderwall.com/p/v65ueq) I show a standard rewrite config snippet, below is the same snippet with added support for WordPress multi-site rewrites.
When enabling a WordPress network this is what you add to your Nginx conf file instead of copying and pasting the content that WordPress suggests for an .htaccess file.
Rewrite for multi site files
rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last;
Rewrite for wordpress
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
Written by Joe Gardiner
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Nginx
Authors
reiaguilera
279.6K
jamesdullaghan
90.19K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#