Last active
November 15, 2018 06:25
-
-
Save rinatkhaziev/4925b71995bb9b9e1953987cb203b5c7 to your computer and use it in GitHub Desktop.
Nginx rewrite rules when WordPress core files are in a subfolder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Files are physically in `wp` subfolder but we'd like to serve requests / | |
# Goes inside server { } block | |
if (!-e $request_filename) { | |
# Add trailing slash to */wp-admin requests. | |
rewrite /wp-admin$ $scheme://$host$request_uri/ permanent; | |
# WordPress in a subdirectory rewrite rules | |
rewrite ^/([_0-9a-zA-Z-]+/)?(wp-.*|xmlrpc.php) /wp/$2 break; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment