How to setup WordPress Multisite using subdirectories on Warden
Setting up WordPress with Apache is usually an easy task. The autogenerated .htaccess file on installation makes things very easy. However, if you’re using Nginx or Docker orchestration, it can be a bit more difficult. In this post, I’ll discuss the required configuration in Warden to make multisite available.
I hope this helps!
Initialize Warden Wordpress Environment
Now you have initialised .env file and now we need to modify nginix configuration for making availailble with wordpress multisite.
create below file on your
.warden/warden-env.yml
Add below configuration for altering Nginx configuration .
1
2
3
4
5
version: "3.5"
services:
nginx:
volumes:
- ./.warden/nginx/custom.conf:/etc/nginx/default.d/custom.conf
Now create below file
.warden/nginx/custom.conf
Add below configuration in the custom.conf file.
1
2
3
4
5
if (!-e $request_filename) {
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last;
}
Now the environment configuration part is Ready ..
You can Create and start containers
warden env up
Install wordpress
After Installing WordPress
You need to configuer wordpress for Multisite below https://wordpress.org/documentation/article/create-a-network/
To setup a warden environment for wordpress you can refer https://karthikmadathil.github.io/setting-up-php-dev-environment-made-easy-with-warden/
Try your luck!