Multisite routing guide
WordPress multisite .htaccess: subdomains vs subdirectories.
A network is not a single site with more domains. Its rewrite rules have to preserve enough path information for WordPress to identify the right site before it routes the request.
Subdomain and subdirectory installs use similar-looking, but not interchangeable, rewrite rules.
Do not replace it with the shorter single-site block when one subsite has a problem.
A network in a subdirectory needs its network setup output, not a root-install example.
Why the two network types need different rules
In a subdomain network, WordPress identifies a site primarily from the hostname: for example, shop.example.com. In a subdirectory network, the site name is part of the path: for example, example.com/shop/. Apache must leave that first path segment available to WordPress in the subdirectory case.
shop.example.com.The rewrite block handles the usual WordPress paths without a site prefix in the request path./shop/.The rules capture and pass that segment so WordPress can resolve the intended subsite.Use the Network Setup output as the source of truth
WordPress generates a configuration snippet when you create a network. That output reflects the network type and installation path that Core knows about, so it should take priority over copied snippets from a different host or topology. A network that was moved into a subdirectory or changed from subdirectories to subdomains deserves a full configuration review, not a one-line rewrite edit.
The short single-site block can make the main site appear healthy while breaking subsite routes, uploads, or admin requests. Select the correct network type in the generator instead.
Repair a multisite rewrite issue in order
- 01Identify the network type.
Look at a known subsite URL: a unique hostname means subdomains; a first path segment means subdirectories.
- 02Confirm the network root and base path.
Find the directory containing the network’s
wp-config.php. Do not assume it is the web root after a migration. - 03Back up the current root
.htaccess.Preserve any host, cache, HTTPS, or security directives that appear outside the WordPress network markers.
- 04Generate the matching network block.
Choose subdomain or subdirectory in the .htaccess generator; use the Network Setup output for unusual paths.
- 05Test more than the main site.
Open a public page and
/wp-admin/on the main site and on at least one subsite before declaring the repair complete.
Quick answers
Can I use the default single-site .htaccess rules for multisite?
No. Multisite needs its own rewrite block. Subdirectory networks in particular need rules that preserve the subsite path segment.
Do subdomain and subdirectory WordPress networks use the same rules?
No. They share a goal, but subdomain routing is based on the host name while subdirectory routing depends on the first part of the request path.
Where should a multisite .htaccess file live?
Put the network rewrite block in the WordPress network root, normally beside wp-config.php. A subsite does not usually have its own full WordPress root or its own network rewrite block.
Primary reference: WordPress multisite administration documentation.