What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
When WordPress works at the home page but pretty URLs return 404, the usual cause is an incomplete Nginx server block. Nginx does not read .htaccess; add a try_files fallback in the active server block, then verify the document root, PHP-FPM target, and SCRIPT_FILENAME path. For a normal single-site installation whose index.php is in the document root, the essential rule is try_files $uri $uri/ /index.php?$args;.
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
Why WordPress rewrites fail on Nginx
Apache-based WordPress instructions often tell you to edit .htaccess. That advice does not apply to Nginx. Nginx has no per-directory .htaccess-style file, and WordPress cannot write Nginx server configuration automatically. Rewrite behavior must be declared in the Nginx configuration loaded for the hostname.
As an Amazon Associate I earn from qualifying purchases.
A request for a real file, such as a CSS file or an image, can be served directly. A pretty WordPress URL such as /news/example-post/ usually has no matching file or directory. Nginx must internally send that unknown path to WordPress’s front controller, normally /index.php, while preserving the original query string. WordPress then resolves the post, page, archive, REST request, or other virtual URL.
The first diagnostic distinction is important:
- If the home page works but post-name URLs return 404, the fallback in
location /is missing, inactive, or incorrect. - If every PHP request produces a 502, downloads PHP source, or fails before WordPress runs, the PHP-FPM location or socket is wrong; that is a FastCGI problem, not a permalink rule problem.
- If the site works at the root but fails under a path such as
/blog/, the fallback URI and WordPress URL settings must include that prefix.
The correct single-site Nginx pattern
Put the following directives in the server {} block that actually answers the site’s hostname. Set root to the directory containing WordPress’s index.php.
#1 Best Overall
- [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
- [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
- [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
- [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
- [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
server {
server_name example.com;
root /var/www/wordpress;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ .php$ {
include fastcgi.conf;
fastcgi_pass unix:/run/php/php-fpm.sock;
}
}
What each directive does
root /var/www/wordpress;defines the filesystem directory Nginx uses when constructing a path from a request URI. It must contain the WordPress installation and itsindex.php.index index.php;makes/resolve to the PHP front controller when a directory request is served.location /handles ordinary web requests unless a more specific location wins.try_files $uri $uri/ /index.php?$args;checks the requested file, then the requested directory. If neither exists, Nginx internally redirects to/index.phpand appends the original query string.location ~ .php$passes PHP scripts to PHP-FPM. The socket shown is an example; use the socket or TCP endpoint installed on your server.
Nginx’s try_files directive checks candidates in the order written and uses the first one found. If none exists, it internally redirects to the final URI. Because the candidates are evaluated against the active root (or an applicable alias), a wrong root can make every virtual URL appear missing even when the rewrite syntax looks correct.
Why the ?$args suffix matters
The suffix preserves the original query string. Requests such as /search/?s=nginx, tracking parameters, and application-specific arguments should arrive at WordPress with their query data intact. Omitting it can cause searches, filters, REST calls, or plugins that rely on query parameters to behave incorrectly. Keep the suffix in the fallback unless you have a deliberate, tested reason not to.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Do not replace the fallback with a hard 404
A rule such as try_files $uri $uri/ =404; is suitable for a static site, but it rejects WordPress’s virtual paths. It explains the common situation in which the home page and static assets work while every post-name URL returns 404. Route the final candidate to WordPress instead.
Check the active server block before editing anything
A perfect rule has no effect if it is in a file Nginx does not include or in a virtual host that does not answer the request. Confirm all of the following for the hostname and protocol you are testing:
- The
server_namematches the requested domain, including thewwwvariant if it is used. - The block listens on the port reached by the client, commonly HTTP and/or HTTPS.
- The TLS server block is configured separately when HTTPS requests are handled by a different block.
- The
rootpoints to the directory that contains the intended WordPress files. - No earlier or more-specific server block is taking precedence.
On systems that support it, dump the complete effective configuration:
sudo nginx -T
The command tests the configuration and prints included files and their contents. Search the output for duplicate location / blocks, regex PHP locations, try_files, rewrite, root, and alias. This often reveals that an edited file is not included, that a second location overrides the intended one, or that the HTTPS block still contains the old rule.
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 →Rank #2
- 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
- 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
- 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
- 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
- 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
Verify PHP-FPM and the script path
Rewriting only gets the request to PHP. Nginx still has to pass the correct script to the correct PHP-FPM listener.
Socket or TCP endpoint
Check the PHP-FPM pool configuration and the running service for the actual listener. Common deployments use a Unix socket whose filename includes the PHP version, while others use a local TCP address. Replace the example fastcgi_pass value with the endpoint that exists on your machine. A nonexistent socket commonly produces a 502 Bad Gateway.
SCRIPT_FILENAME must resolve to a real file
The FastCGI parameters must map the request to the filesystem location of the script. A typical subdirectory configuration explicitly sets:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
If this value points to a nonexistent path, PHP-FPM may report that the script cannot be found even though the rewrite itself is correct. Conversely, an unsafe or overly broad PHP location can expose files that should not be executed. Keep the PHP location restricted to the intended document root and use the distribution’s maintained FastCGI include where appropriate.
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 problemsSeparate rewrite symptoms from PHP symptoms
- 404 on only virtual URLs: inspect
location /, the fallback URI, and the active root. - 502 on the home page and PHP URLs: inspect the PHP-FPM service, socket or TCP endpoint, and permissions.
- PHP source downloads: inspect whether a PHP location is present and whether the request is actually reaching the expected server block.
- “Primary script unknown” or similar PHP-FPM errors: inspect
SCRIPT_FILENAME,root, and any mismatch betweenaliasand filesystem paths.
Fix a WordPress installation in a subdirectory
Suppose the public site is https://example.com/blog/ and WordPress’s files, including index.php, are under the corresponding installation directory. The fallback must enter /blog/index.php, not the root-level /index.php.
location /blog/ {
try_files $uri $uri/ /blog/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 PHP version, socket path, document root, and blog prefix in this example are environment-specific. Adapt each one to the actual server rather than copying it unchanged.
Rank #3
- [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
- [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
- [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
- [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
- [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
Three paths must agree
| Layer | What must match | Typical mistake |
|---|---|---|
| Public URL | The prefix users request, such as /blog/ |
Using a root fallback for a prefixed installation |
| Nginx filesystem mapping | root or alias that reaches the WordPress files |
Pointing at the parent directory or an old release |
| WordPress settings | Site URL and home URL that reflect the intended public address | Mixing root and subdirectory URLs |
| PHP mapping | SCRIPT_FILENAME resolves to the real script |
Appending the URI prefix twice or omitting it |
Test a static asset and a known post under the prefix. If /blog/ loads but /blog/post-name/ does not, inspect the prefixed try_files rule first. If both fail, verify the root and URL settings before changing rewrite directives.
Use a different procedure for multisite
Multisite is not a drop-in extension of the single-site snippet. WordPress documents separate Nginx variants for subdirectory networks and subdomain networks, with additional rewrites and safeguards. The correct block depends on the network layout and the WordPress version.
Windows 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 reinstallOutdated 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 match- For a subdirectory network, the request path contains the network and site prefixes; use the documented multisite rules rather than adding a single-site root fallback alone.
- For a subdomain network, confirm wildcard DNS and the server’s hostname handling as well as the Nginx rewrite rules.
- Preserve the network’s special handling for administrative paths, static files, and uploaded content.
If a network breaks after a generic single-site change, restore the previously documented network block and compare it with the active configuration using nginx -T. Do not solve a multisite problem by repeatedly adding overlapping location / blocks.
Validate safely, then reload
Never reload an untested configuration. Use this sequence after every change:
- Save the edited server configuration.
- Run
sudo nginx -t. Nginx checks syntax and attempts to open referenced files. Fix every reported error before continuing. - Apply the accepted configuration with
sudo nginx -s reload, or use the equivalent command supplied by your service manager. - Request the home page, a known post,
/wp-admin/, a static asset, and/wp-json/if the site uses the REST API. - Watch the access log and error log while making those requests. Compare status codes and error messages rather than relying only on the browser’s generic error page.
A reload tells Nginx to accept the new configuration and gracefully retire old workers. If the test fails, the old configuration remains in service; do not assume a failed edit was applied.
Flush WordPress’s rewrite state after the server route is fixed
WordPress stores rewrite rules for registered post types and other permalink structures. Once Nginx is routing requests correctly, refresh that state in the dashboard:
Rank #4
- Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
- Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
- All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
- Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
- Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
- Open Settings > Permalinks in
wp-admin. - Click Save Changes without changing the structure.
- If the problem persists, temporarily select a default structure, save it, select the desired structure again, and save once more.
This operation can flush stale WordPress rules, but it cannot compensate for a missing Nginx fallback, an incorrect root, or a broken PHP-FPM connection. Fix the server route first.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Common symptoms and the exact fix path
Home page works, posts return 404
Check that the active location / ends with /index.php?$args, not =404. Use nginx -T to make sure the block belongs to the hostname and HTTPS listener being tested. Then run nginx -t and reload.
Plain permalinks work but Post name fails
Plain permalinks put the post identifier in a query string and therefore can work without virtual-path routing. The Post name structure requires Nginx to send an unknown path to WordPress. Verify try_files, the document root, and the selected server block before changing WordPress code or plugins.
Every request returns 502
Inspect the PHP-FPM service and the value of fastcgi_pass. Confirm that the socket exists or that the TCP listener accepts connections. Then check SCRIPT_FILENAME and the document root. A 502 indicates that Nginx cannot complete the FastCGI handoff; it is not evidence that the permalink structure is wrong.
PHP files download instead of executing
The request is probably reaching a server block without a PHP location, or a conflicting location is winning. Inspect the complete configuration for regex PHP locations and confirm that the intended block includes the FastCGI parameters and points to PHP-FPM.
The root URL works but /blog/ does not
Use a location and fallback that include the public prefix, such as location /blog/ with /blog/index.php?$args. Check that the Nginx root and WordPress home and site URLs describe the same layout.
Best Value
Changing the file has no effect
The file may not be included, another virtual host may answer the request, or Nginx may still be running the previous configuration. Dump the effective configuration with nginx -T, test with nginx -t, reload successfully, and verify the response again while watching the logs.
Only one URL family fails
Compare the failing URI with the winning Nginx location. A more-specific prefix location, a regex location, an alias, or a separate language or application mount can bypass the generic location /. The effective configuration and error log are more reliable than the file you expect Nginx to be using.
Recommended Free Tools
When Nginx sits in front of another web server
Some deployments use Nginx as a reverse proxy in front of Apache or another application gateway. In that design, determine which layer owns the WordPress rewrite. If Nginx serves the files and sends PHP directly to PHP-FPM, use the Nginx pattern in this guide. If Nginx proxies the request to Apache, the upstream server may process .htaccess, while Nginx still needs correct proxy routing and headers. Do not install both independent rewrite schemes without checking which server receives the request first.
The decisive questions are:
- Which process serves static files?
- Which process receives the unknown pretty URL?
- Where does PHP execute?
- Which configuration can you edit and reload?
Managed hosting and restricted access
If you cannot edit server blocks, inspect the effective configuration, read logs, or reload Nginx, the practical fix is to open a support request with the host or administrator. Provide the affected hostname, one working URL, one failing URL, the permalink structure, whether the installation is at the root or in a subdirectory, and the exact status code. Ask them to verify the active server block, try_files fallback, PHP-FPM endpoint, and SCRIPT_FILENAME.
Support teams can make the change safely because they control the service configuration. Repeatedly changing WordPress permalink settings without correcting the server route will not create an Nginx rewrite rule.
A compact verification checklist
- Is the request reaching the intended hostname, port, and TLS server block?
- Does
rootcontain the WordPressindex.phpused by this site? - Does
location /usetry_files $uri $uri/ /index.php?$args;for a root install? - For a subdirectory install, does the fallback include the public prefix?
- Is the PHP-FPM socket or TCP endpoint real and reachable?
- Does
SCRIPT_FILENAMEresolve to the requested script? - Have you checked the complete output of
nginx -Tfor competing locations and roots? - Did
sudo nginx -tpass before you reloaded? - Did you test a post, administration URL, static asset, and REST endpoint where applicable?
- Did you save the Permalinks screen after the server route was corrected?
What a successful repair looks like
A repaired root installation serves existing files directly, sends unknown paths to /index.php with their query strings, and passes that script to the intended PHP-FPM listener. A repaired subdirectory installation does the same with its prefixed fallback. Nginx’s loaded configuration, filesystem paths, WordPress URLs, and PHP-FPM parameters all describe the same layout. Once those pieces agree, WordPress can resolve pretty permalinks without an Apache-style .htaccess file.
Free tools Windows power users keep installed
One-click scans. No signup required.
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.




