Recommended Free Tools
On a LEMP server, a missing URL can be handled by Nginx or by WordPress. For a theme-integrated not-found page, keep try_files $uri $uri/ /index.php?$args; in the location / block and customize the active theme’s 404 template. For a lightweight page that must work even when PHP is unavailable, map the error at Nginx with error_page 404 /404.html;. In both cases, validate the configuration and confirm that a deliberately missing URL returns HTTP 404 rather than a redirect or a misleading 200 response.
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
How 404 handling works on a WordPress LEMP server
LEMP means Linux, Nginx, a database such as MySQL or MariaDB, and PHP. Nginx receives the HTTP request first. It decides whether the requested path is an existing file or directory, whether the request should be passed to PHP-FPM, and whether an error response should be replaced with a configured error page. WordPress then interprets requests that do not correspond to real files, including posts, pages, categories, and other pretty-permalink routes.
As an Amazon Associate I earn from qualifying purchases.
That creates two separate sources of a 404:
- Nginx 404: Nginx cannot find a file or directory and ends the request, often displaying its plain built-in error page.
- WordPress 404: Nginx passes the request to
index.php; WordPress searches its rewrite and content rules, finds no matching object, and loads the active theme’s 404 template.
Your configuration must decide which layer owns the response. The decision affects PHP availability, visual consistency, search and navigation features, caching, and the likelihood of accidentally masking the real HTTP status.
Choose the right 404 owner
| Requirement | Use a WordPress theme 404 | Use a static Nginx 404 |
|---|---|---|
| Site header, footer, menus, search, or theme styles | Best fit. WordPress renders the active theme template. | Requires reproducing those elements manually and keeping them synchronized. |
| Must function while PHP-FPM or WordPress is unavailable | No. It depends on PHP and WordPress. | Best fit. Nginx can serve a static file without PHP. |
| Configuration location | WordPress theme files, with Nginx forwarding requests correctly. | Nginx server block and a static file in the document root. |
| Dynamic search or context-aware navigation | Available through theme and WordPress functions. | Not available unless implemented as client-side code or static markup. |
| Performance and dependency count | Runs through PHP and WordPress. | Very lightweight and independent of the application stack. |
| Status-code control | WordPress should emit 404; do not redirect to the home page. | Nginx’s error_page handling preserves the error status when configured normally. |
Use the theme route for a normal public site where a missing page should look and behave like the rest of the site. Use a static Nginx page for server-level failures, an emergency fallback, or an installation where PHP may be down. Do not configure both to compete for the same response without understanding which directive terminates the request first.
#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.
Prepare the server before changing 404 behavior
Make a copy of the Nginx server block and the active theme’s 404 template before editing. You need administrative access to the server, the WordPress document root, and the PHP-FPM socket or upstream used by your installation. Replace the example paths and socket with the values used by your host.
- Know the document root, such as
/var/www/example.com. - Know the PHP-FPM endpoint, such as
unix:/run/php/php-fpm.sock. - Confirm that the active WordPress theme, not an inactive theme, is the file you intend to edit.
- Have a way to test both HTTPS and the canonical hostname if Nginx uses separate server blocks.
Nginx does not read Apache’s per-directory .htaccess files. An Apache rewrite recipe copied into a LEMP installation will not supply WordPress permalinks with a fallback, and every pretty URL may therefore become an Nginx 404.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Install the standard WordPress Nginx routing
The essential route belongs in the server block’s location / section:
server {
server_name example.com;
root /var/www/example.com;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ .php$ {
include fastcgi.conf;
fastcgi_intercept_errors on;
fastcgi_pass unix:/run/php/php-fpm.sock;
}
}
try_files checks the requested path in order. If $uri is a real file, Nginx serves it. If $uri/ is a real directory, Nginx processes that directory. When neither exists, Nginx internally sends the request to /index.php and appends the original query string through ?$args. WordPress can then resolve a virtual permalink or determine that the URL is genuinely missing.
The PHP location must pass scripts to PHP-FPM. It must not serve PHP files as downloadable static files. The example’s fastcgi_intercept_errors on; allows Nginx to intercept certain responses generated by FastCGI, which is relevant if you also configure Nginx-level error handling. Keep the directive aligned with the behavior you want rather than adding an unrelated Apache directive.
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
Option 1: Serve a static 404 from Nginx
Choose this option when the not-found page must be available without WordPress or PHP. Add the following directives in the appropriate Nginx server block:
error_page 404 /404.html;
location = /404.html {
internal;
}
Create 404.html beneath the configured document root, for example /var/www/example.com/404.html. Keep the page self-contained: include a clear explanation, a link to the site’s main entry point, and any critical contact or status information. Use ordinary static assets only if those assets are available at paths that Nginx can serve.
error_page 404 /404.html; is an internal redirect instruction. It tells Nginx how to process the error; it is not the same as sending a client-side 301 or 302 redirect. The internal modifier prevents visitors from requesting the error endpoint directly. Nginx can still use it internally when a request produces a 404.
Do not redirect every missing URL to the home page. A redirect hides the fact that the requested resource does not exist, confuses browsers and crawlers, and can turn a not-found response into a misleading 200 page. The error page should remain an HTTP 404.
When the static route is safer
- PHP-FPM is down or being restarted and visitors still need a usable error response.
- The page is intended for server-level errors rather than WordPress content.
- You need the smallest possible dependency chain and do not need theme-aware navigation.
- You are building an emergency fallback while repairing the application.
Option 2: Let WordPress render the theme 404
For a page that uses the site’s normal header, footer, navigation, search form, and styles, keep the WordPress try_files fallback and customize the active theme. Do not add an Nginx rule that terminates missing paths before they reach index.php.
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)
Classic themes: edit 404.php
Classic themes use 404.php for a page-not-found request. A minimal structure is:
<?php
get_header();
?>
<main id="primary" class="site-main">
<h1>Page not found</h1>
<p>The page may have moved, or the address may be incorrect.</p>
<?php get_search_form(); ?>
</main>
<?php
get_footer();
Use the theme’s existing markup, classes, escaping, localization, and accessibility conventions instead of pasting this fragment unchanged into a complex theme. Keep the heading specific, offer a search form where it is useful, and provide a route back to relevant navigation. The template should allow WordPress to send a 404 status; it should not call a redirect that changes the response to 200.
Some themes already contain a 404 template. In that case, adjust its content and styling rather than creating a second file with a different name. Changes made to a parent theme can be overwritten by updates, so use the theme’s supported child-theme workflow when one is available.
Block themes: edit templates/404.html
Block themes use the template hierarchy under the theme directory. Create or edit templates/404.html. WordPress checks this 404 template before falling back to templates/index.html. Build the page with the block editor or the theme’s existing template markup, retaining the site header, navigation, search, and footer patterns where appropriate.
Do not replace the missing-page response with a home-page redirect simply because the block template is visually minimal. The purpose of the template is to explain that the requested URL was not found while preserving the HTTP 404 status.
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
Understand the interaction between try_files, error_page, and PHP
A request for an existing image, stylesheet, or script normally succeeds in location / because try_files finds the file. A request for a real WordPress permalink usually fails the filesystem checks but is then sent to index.php, where WordPress resolves it. A request for a nonexistent slug follows the same path until WordPress loads its 404 template.
If you instead add a terminating fallback such as try_files $uri $uri/ =404;, Nginx stops before WordPress can inspect the URL. That produces an Nginx error page even when the requested path could have been a valid post or page. Use the WordPress fallback unless you intentionally want Nginx to own all missing paths.
An error_page 404 /404.html; rule can also replace an Nginx-generated 404 with a static file. If the request reaches WordPress and WordPress generates the 404, whether Nginx intercepts and replaces it depends on the surrounding FastCGI and error-handling directives. Decide explicitly whether your static page is an emergency/server-level response or the normal public 404. Avoid layering a static replacement over a carefully designed theme template without testing both paths.
Deploy the change safely
- Back up the configuration and template. Save the complete Nginx server block and the current
404.phportemplates/404.html. - Check the document root. Confirm that the
rootdirective points to the directory containing WordPress’sindex.php. - Review the PHP handler. Confirm that the PHP location includes the correct FastCGI configuration and sends scripts to PHP-FPM.
- Validate syntax. Run
sudo nginx -t. Do not reload if this command reports an error; fix the reported file and line first. - Reload Nginx after a successful test. A common command is
sudo nginx -s reload. Use your platform’s normal reload mechanism if it differs. - Test an existing static file. Request a known image, stylesheet, or other file and confirm that it is served normally.
- Test an existing permalink. Open a known post or page and verify that its normal WordPress template still loads.
- Test a deliberate miss. Request a path such as
/this-url-should-not-existand confirm that the intended Nginx or theme design appears. - Inspect the status directly. Run
curl -I https://example.com/this-url-should-not-existand verify an HTTP404, not200,301, or302.
Test from the public HTTPS hostname, not only from an internal address. A separate redirecting server block, CDN, or HTTPS configuration can otherwise make a correct application response appear incorrect.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot the common failure modes
Every pretty permalink returns an Nginx 404
- Open the active server block and verify that
location /containstry_files $uri $uri/ /index.php?$args;. - Check that
rootpoints to the WordPress document directory, not its parent or a directory containing a second installation. - Look for a more specific location block or an earlier rule using
try_files ... =404that terminates the request. - After correction, run
sudo nginx -t, reload, and test a known permalink again.
The page is the plain Nginx error screen
Check for an error_page directive, a terminating try_files fallback, or a location rule that prevents the request from reaching PHP. If you intended a WordPress 404, remove or revise the rule that intercepts the request. If you intended a static page, confirm that the mapped file exists beneath the configured root and that the exact-location block is reachable internally.
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.
WordPress shows a 404 but the design is wrong
Confirm which theme is active and whether it is classic or block-based. Edit the active theme’s 404.php or templates/404.html, not a similarly named inactive theme. Clear any page or object cache after deployment, then request a fresh deliberately nonexistent URL.
The missing URL returns 200 or redirects home
Inspect the response with curl -I and remove redirect logic from the theme, plugin, Nginx configuration, or upstream proxy. A custom not-found design is useful only when the response remains 404. Redirecting every miss to the home page conceals broken links and makes automated status checks unreliable.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsPHP files download or appear as source code
Stop serving the site publicly until this is corrected. The PHP location is not passing scripts to PHP-FPM. Check the location ~ .php$ block, its fastcgi_pass socket or upstream, and the included FastCGI parameters. After fixing the handler, run the syntax test and verify that a PHP request is executed rather than downloaded.
The static error page loops or cannot be opened
Check that 404.html exists at the path implied by root. Keep the target location exact and marked internal. Do not apply a second error_page 404 rule to the error endpoint itself, and ensure that its stylesheet and images do not point to nonexistent paths that trigger another error during rendering.
Make the final 404 useful and safe
- State plainly that the requested page was not found; do not pretend the page loaded successfully.
- Offer a search form or relevant navigation on a WordPress template, and a simple home or section link on a static page.
- Keep the response accessible: use a logical heading, readable contrast, keyboard-accessible links, and meaningful link text.
- Avoid exposing filesystem paths, PHP warnings, stack traces, server versions, or database details.
- Keep static error assets small and avoid dependencies that require the unavailable application layer.
- Log and monitor repeated 404s separately from server failures so broken links and probing activity can be distinguished.
- Do not add a catch-all redirect merely to eliminate 404 reports; fix internal links and preserve the correct status for genuinely missing resources.
A practical decision checklist
| Question | Decision |
|---|---|
| Should the page share the active theme’s header, footer, search, and navigation? | Use WordPress routing and customize 404.php or templates/404.html. |
| Must the page work when PHP-FPM or WordPress is unavailable? | Use Nginx’s error_page 404 /404.html; mapping. |
| Are valid WordPress permalinks failing before WordPress sees them? | Restore try_files $uri $uri/ /index.php?$args; in location /. |
| Does a missing URL return a redirect or 200? | Remove catch-all redirect logic and verify the final status with curl -I. |
| Did a configuration edit change behavior unexpectedly? | Restore the backup, run sudo nginx -t, reload only after it passes, and retest all three request types. |
The reliable baseline is straightforward: route non-file URLs to WordPress with the standard try_files fallback when the theme should own the experience, or map a deliberately static internal endpoint with Nginx when independence from PHP matters. Whichever design you choose, test an existing file, an existing permalink, and a known missing URL, and verify that the final response is an honest HTTP 404.
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.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →




