Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Default .htaccess file for sub-directory installations of WordPress Multisite for versions 3.5+.
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
@creativeartbd
Copy link

creativeartbd commented Sep 20, 2020

Thank You so much. It's worked and helped me.

@mashraf1997
Copy link

mashraf1997 commented Dec 12, 2020

thank you

@hghetti
Copy link

hghetti commented Jan 28, 2021

thanks

@netdesignr
Copy link

netdesignr commented Feb 18, 2021

Thank you!

@gmitops
Copy link

gmitops commented Sep 27, 2021

It just worked for me too. Thanks!

I think the one generated is for sub domains not directories.

@jennimckinnon
Copy link
Author

jennimckinnon commented Oct 5, 2021

It just worked for me too. Thanks!

I think the one generated is for sub domains not directories.

Thanks for bringing it up! Wouldn't be surprised if I accidentally swapped them haha. I just double checked and it still looks accurate according to the WordPress handbook: https://wordpress.org/support/article/multisite-network-administration/#htaccess-and-mod-rewrite

@aline74
Copy link

aline74 commented Mar 11, 2022

Thank you so much !!! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment