Here, we provide the process to update the .htaccess file for use with WP Multisite.
This will need to be done after manually installing WordPress Multisite.
Related Articles
Manually Install WP Multisite
Install WordPress/WP Multisite with Softaculous
Update .htaccess
-
Edit the .htaccess file in the domain's document root
NOTE: You can do this using the File Manager in cPanel or by command line using your preferred text editor.
TIP: If you do not see the .htaccess file, be sure to enable Show Hidden Files. -
Remove the WordPress redirect if applicable
NOTE: WordPress uses the following for single-site redirects.
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress -
Add the appropriate WP Multisite redirect
-
For a subdirectory-based multisite
# BEGIN WordPress Multisite # Using subfolder network type: https://wordpress.org/documentation/article/htaccess/#multisite RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 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] # END WordPress Multisite
-
For a subdomain-based multisite
# BEGIN WordPress Multisite # Using subdomain network type: https://wordpress.org/documentation/article/htaccess/#multisite RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] # add a trailing slash to /wp-admin RewriteRule ^wp-admin$ wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^(wp-(content|admin|includes).*) $1 [L] RewriteRule ^(.*\.php)$ $1 [L] RewriteRule . index.php [L] # END WordPress Multisite
-
For a subdirectory-based multisite