ThemesByte

WordPress multisite got 404 when accessing sub-sites

If you getting 404 error on your multisite sub-sites you can fix this error by 3 steps.

  1. Go to your sites root folder you can see there wp-config.php Add below codes on wp-config.php files.
define('WP_ALLOW_MULTISITE', true); //change it to false afterwards  

Can you then go to /wp-admin/network/setup.php and check you copied everything correctly. Don’t forget to log in to your main site. If everything is okay then you can see like below screenshot.

2. Add the following to your wp-config.php file in your root folder.

define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'yoursite.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

3. Add the following to your .htaccess file in your root folderreplacing other WordPress rules:

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]

And you’ve put your code inside <IfModule mod_rewrite.c></IfModule> which is not in the WordPress instructions

Rafiul

Hi, I am B M Rafiul Alam full-stack WordPress developer. I love to develop WordPress themes and Plugins. I developed a couple of themes and plugins for the Wordpress.org repository.