The reliable way to run several WordPress sites at paths such as https://example.com/news and https://example.com/reviews is a single WordPress Multisite network configured for subdirectory sites, with one Nginx server block forwarding virtual site paths to the network’s shared index.php. These paths are logical network routes, not separate folders containing separate WordPress installations. Enable Multisite first, copy the rewrite rules WordPress generates, then adapt the official Nginx pattern to your domain, document root and PHP-FPM endpoint.
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
What a subdirectory Multisite network actually is
WordPress Multisite lets one WordPress installation host multiple sites. In a path-based network, the main site might be https://example.com/, while additional sites use paths such as https://example.com/news and https://example.com/reviews. WordPress describes this as a sub-directory install that creates a path-based network even though it does not use file-system directories.
As an Amazon Associate I earn from qualifying purchases.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
That distinction determines the Nginx design. You do not create /var/www/example.com/htdocs/news and place another copy of WordPress there. The network shares one code tree, one WordPress core and one PHP entry point. WordPress maps the requested path to the site record in the network database. Nginx must therefore preserve the path for ordinary front-end requests while removing the path prefix for core and PHP endpoints that belong to the shared installation.
Why choose paths instead of subdomains?
Subdirectory URLs keep every site under one host name, so you avoid the additional DNS work required for subdomains. They are often convenient when the sites share a brand, TLS certificate and operational team. The trade-off is that the Nginx rewrite order and WordPress network constants must be correct: a missing rewrite can produce a 404 for every subsite permalink even when the files and database are healthy.
#1 Best Overall
- BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
- EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
- COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
- LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
- WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
Plan the deployment before editing Nginx
- Back up the current site and database. Keep a tested copy of the WordPress files, the database and
wp-config.phpbefore enabling network features. - Choose the network host and paths. Decide the canonical host, HTTPS policy and path names, such as
/newsor/reviews. Avoid changing a path casually after launch because links, media URLs and cookies can depend on it. - Confirm the document root. You need the absolute directory that contains the existing WordPress
index.php,wp-admin,wp-contentandwp-includesdirectories. - Identify PHP-FPM. Record the Unix socket or upstream name used by this server. Distribution packages and PHP versions use different socket paths; the example below is only a pattern.
- Schedule a maintenance window. Network activation changes configuration and database behavior. Have console or hosting-panel access available in case Nginx cannot reload.
- Check permissions and TLS. The Nginx worker must read the document root and PHP-FPM must be reachable. Serve the network over HTTPS and keep the certificate valid for the host name users will enter.
Enable WordPress Multisite with subdirectory sites
Do this in the existing, working WordPress installation. The network screen generates values specific to your domain and path, so do not copy constants from another installation.
- Make and verify a backup. Export the database and preserve the current files. Confirm that you can restore them before proceeding.
- Allow network setup. Edit the main installation’s
wp-config.phpand add this line before the line that says WordPress is finished loading its settings:define('WP_ALLOW_MULTISITE', true);
Save the file, sign in to the WordPress administrator and open Tools → Network Setup (the exact menu label can vary slightly by WordPress version). - Select the subdirectory option. In Network Setup, choose subdirectory sites when WordPress offers the choice. WordPress will display network-specific constants and rewrite instructions. They include the network URL and the path under which sites are registered.
- Apply every generated WordPress change. Copy the constants into
wp-config.phpexactly as shown, preserving their order and values. If WordPress asks you to add or adjust cookie, site URL or database-related constants, use the generated text rather than inventing replacements. - Apply the generated server rules. The Network Setup screen presents rewrite guidance for the web server. For Nginx, use the Multisite subdirectory pattern in the next section and adapt only deployment-specific values. Do not paste Apache
.htaccessdirectives into Nginx. - Log back in and create sites. Open Network Admin → Sites → Add New. Enter each site’s path, title and administrator address. Record the resulting domain and path values, then verify that each URL follows the intended form, such as
https://example.com/news.
If the network screen offers subdomains rather than subdirectories, check the existing site’s URL and WordPress version before accepting. A subdomain network is a different routing choice and requires separate DNS and Nginx handling.
Use this Nginx server-block pattern
The following is the core pattern for WordPress 3.5-and-newer Multisite activated as subdirectories. Replace example.com, the document root and the PHP-FPM upstream or socket with values from your host.
server {
server_name example.com;
root /var/www/example.com/htdocs;
index index.php;
if (!-e $request_filename) {
rewrite /wp-admin$ $scheme://$host$request_uri/ permanent;
rewrite ^(/[^/]+)?(/wp-.*) $2 last;
rewrite ^(/[^/]+)?(/.*.php) $2 last;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ .php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass php;
}
}
What each part does
server_name example.com;selects the host handled by this block. Use the canonical host that WordPress stores for the network; add aliases only when you intentionally support them.root /var/www/example.com/htdocs;must point to the directory containing the shared WordPress files. A wrong root makes static files disappear and can send PHP requests to the wrong installation.index index.php;lets Nginx use WordPress’s front controller for a directory request.- The
if (!-e $request_filename)section runs when the requested path is not an existing file. The first rewrite adds a trailing slash to a bare/wp-adminrequest. The next two rewrites remove an optional first path component from WordPress administration and PHP endpoints. For example, a request beginning with/news/wp-admin/is handed to the shared/wp-admin/path, while the network context remains available to WordPress through the request and its configured constants. location /tries a real file or directory first. If neither exists,/index.php?$argsreceives the request and keeps the original query string. This fallback is what allows WordPress to resolve site paths and post permalinks.location ~ .php$prevents Nginx from passing a nonexistent PHP file to PHP-FPM, loads the FastCGI parameters and sends valid scripts to the configured PHP-FPM upstream.
Keep the ordering intact while adapting the values. The PHP endpoint named php in the example might instead be an upstream block or a Unix socket on your server. Use the socket or upstream already used by the working single-site configuration, and make sure its PHP version is compatible with the WordPress installation.
Rank #2
- WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
- AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
- PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
- ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
- COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
Keep reusable rules in include files
On a server hosting several virtual hosts, place common security restrictions and WordPress routing rules in include files, then include the Multisite subdirectory file from the appropriate server block. This avoids small differences in rewrite order between sites and gives you one place to update a rule.
Do not merge unrelated applications into the same location block without checking their precedence. A generic PHP location, a cache rule or another front controller can intercept a request before the Multisite rules run. If you must add caching, authentication or another application, test requests for both the root site and a subsite after each change.
Recommended Free Tools
Validate the configuration and the network
Use a short, repeatable verification runbook every time you change Nginx, PHP-FPM or network paths.
- Run
nginx -t. Do not reload until the syntax check reports success. Fix missing semicolons, invalid include paths and unavailable upstreams first. - Reload Nginx using your operating system’s normal service method, for example
sudo systemctl reload nginx. A reload applies the new configuration without stopping the service. - Open the root site’s front page over its canonical HTTPS URL.
- Open at least one subsite front page, such as
https://example.com/news. - Open a post permalink on the subsite. This exercises the
try_filesfallback rather than only the home-page directory request. - Open the root site’s
/wp-admin/and the subsite’s/news/wp-admin/. Confirm that neither URL loops, loses the path or redirects to the wrong host. - Load a static CSS or JavaScript asset from the root site and from the subsite. A missing asset can reveal an incorrect root or a rewrite that is too broad.
- Review the Nginx error log and PHP-FPM log while performing the tests. Record the exact request path and status code before changing another rule.
| Test | Expected result | What it exercises |
|---|---|---|
| Root front page | Loads on the canonical host | Server selection, document root and front controller |
| Subsite front page | Loads at its configured path | Network path mapping and fallback routing |
| Subsite post permalink | Returns the post, not a 404 | try_files fallback and WordPress rewrite handling |
| Subsite administrator | Loads at the path-prefixed /wp-admin/ |
Multisite rewrite rules and generated constants |
| CSS or JavaScript asset | Returns the file with a successful response | Static-file handling and the correct root |
Troubleshoot the common failure modes
Every subsite permalink returns 404
This usually means the request never reaches /index.php?$args, or the Multisite subdirectory rewrite block is missing or in the wrong server block. First run nginx -t, confirm that the request’s host matches server_name, and verify the location / fallback. Then check that the three rewrites inside the if (!-e $request_filename) block are present and ordered as shown. Retest a subsite home page and a post permalink after reloading Nginx.
Rank #3
- Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
- Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
- Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
- ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
- Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
The browser downloads a PHP file
A PHP download means Nginx is serving the script as a static file instead of sending it to PHP-FPM. Check that the location ~ .php$ block is active in the selected server block, that its regular expression was not overridden by another location, and that the document root is correct. Never leave PHP files downloadable; correct the location and reload before making the site public.
Requests return 502 Bad Gateway
A 502 generally points to the PHP-FPM endpoint: the socket path may be wrong, the service may be stopped, or Nginx may lack permission to access the socket. Compare fastcgi_pass with the endpoint used by a known-good PHP site on the same host, confirm that PHP-FPM is running, and inspect its log for connection errors.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallAdministrator URLs loop or lose the site path
Compare the constants generated by WordPress Network Setup with the values currently in wp-config.php. Then inspect rewrite ordering. The trailing-slash rule for /wp-admin and the two prefix-removal rules must execute before the general front-controller handling. Also check for a second server block that redirects the request to a different host or path.
The root site works but a subsite’s assets do not
Confirm that the subsite asset URL includes the expected path and that Nginx can read the corresponding file under the shared root. A broad rewrite or an incorrect root can send a real asset to PHP or to the wrong application. Test one CSS file and one JavaScript file directly, then inspect the response status and Nginx log.
Rank #4
- Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
- Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
- 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
- Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
- USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
Uploads or sensitive files are exposed
Review the host’s normal Nginx restrictions and filesystem permissions. Upload directories should not permit arbitrary executable scripts, and configuration backups, logs and private files should not be publicly readable. Apply the same restrictions consistently to the root site and every network path.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Do not confuse two different “subdirectory” layouts
People often use “WordPress in a subdirectory” to describe two unrelated configurations. Choose the row that matches your intended architecture before writing Nginx rules.
| Layout | What is shared | What the URL means | Nginx consequence |
|---|---|---|---|
| Multisite with subdirectory sites | One WordPress code tree hosts multiple database-registered sites | /news is a virtual network path, not a folder containing another core installation |
Use the Multisite subdirectory rewrites and send unknown paths to the shared index.php |
| Single site with core stored in a directory | One site and one database; core files live under a directory such as /my_subdir |
The public location may be higher than the directory that stores WordPress files | Use a location such as /my_subdir/ with a matching front-controller fallback and PHP path handling |
For the second layout, WordPress documents this Nginx form:
location /my_subdir/ {
try_files $uri $uri/ /my_subdir/index.php?$args;
}
location ~ .php$ {
fastcgi_split_path_info ^(.+.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
The socket shown is an example path, not a universal PHP-FPM location. Adapt the PHP version, socket and document root to your host. Do not combine this single-site arrangement with the Multisite path rewrites unless you have a specific, tested reason to do so.
Best Value
- Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
- Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
- Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
- Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
- Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
Subdirectories versus subdomains: the practical decision
| Consideration | Subdirectory Multisite | Subdomain Multisite |
|---|---|---|
| URL style | example.com/site-path |
site.example.com |
| DNS work | Uses the existing host, so additional site DNS records are generally unnecessary | Requires DNS and host configuration for the subdomains you publish |
| Branding | All sites visibly share the main host | Each site gets a distinct host name |
| Cookies and domain behavior | Sites operate beneath one host and path scheme; generated network constants must match it | Host names are separate, so domain and cookie settings require their own validation |
| Nginx routing | Path-prefix rewrites are required for the shared installation | Host-based routing and the separate subdomain pattern are required |
| Migration planning | Changing a site path affects links and path-based URLs | Moving between host names affects DNS, certificates and host-based URLs |
Use the path-based design when a shared host and simpler DNS administration matter more than independent host names. Use a subdomain design when each site must have a distinct host identity and you are prepared to manage its DNS and host routing.
Operate the network safely after launch
- Back up the network as a unit. A single code tree serves every site, while the database contains network-wide and site-specific records. Back up both before WordPress, plugin or Nginx changes.
- Document the mapping. Keep a list of each site’s domain and path, administrator contact and intended canonical URL. This makes it easier to spot a path typo during incident response.
- Reload and retest after every routing change. A successful Nginx syntax check does not prove that WordPress paths work. Repeat the root, subsite, permalink, administrator and asset tests.
- Keep permissions least-privilege. Nginx needs read access to public files and PHP-FPM needs the access required to execute the installation. Do not make the entire document root writable by the web process.
- Review logs by host and path. Include the request host and URI when investigating redirects, 404s and 502s. The same status code can have different causes on the root site and a subsite.
- Preserve HTTPS and canonical redirects. Configure TLS and redirects at the server level for the host used by the network, then verify that redirects retain the subsite path.
A repeatable change checklist
- Export the database and back up the files.
- Confirm the intended host, path names, document root and PHP-FPM endpoint.
- Enable
WP_ALLOW_MULTISITEand complete Network Setup with subdirectory sites selected. - Copy the generated WordPress constants into
wp-config.php. - Install the Nginx Multisite subdirectory pattern in the correct server block.
- Replace the example server name, root and PHP-FPM target with deployment values.
- Run
nginx -t; fix all errors. - Reload Nginx.
- Create a test subsite and verify its front page, post permalink, administrator and static assets.
- Only after the test passes, create the remaining sites and record their paths.
Frequently Asked Questions
Are the subdirectories real folders on the server?
No. In a path-based WordPress Multisite network, a path such as /news is a virtual site route stored in the network configuration and database. The sites share one WordPress code tree.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesWhy does the main site work while every subsite permalink is a 404?
The request is usually not reaching the shared /index.php?$args fallback, or the Multisite subdirectory rewrite block is absent, attached to another server block or ordered incorrectly. Check the try_files rule and the three prefix-removal rewrites, then run nginx -t and reload.
Can I use the single-site /my_subdir/ Nginx example for a Multisite network?
No. That example is for one WordPress site whose core files are stored in a directory. A Multisite subdirectory network uses virtual site paths and needs the Multisite rewrite pattern shown above.
What should I change in the sample Nginx block before using it?
Change server_name, root and fastcgi_pass to your host’s canonical domain, actual WordPress document root and working PHP-FPM upstream or socket. Keep the rewrite and try_files structure unless your deployment has a tested alternative.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →

