WordPress Homepage Loaded but Posts, Pages, Product, or Category Links Returning 404, Typically Indicates Rewrite Rules Not Applied to Server, Check Permanent Link Setting, .htaccess, Nginx try_files, Document Root, and Slug Conflicts
404 Not Found
The requested URL was not found on this server
nginx: open() /var/www/html/ornek-yazi failed
WordPress does not store beautiful URLs as physical files. The web server redirects the request to index.php and WordPress finds the correct content. If the rewrite chain is broken, other URLs may return a 404 error while the homepage works.
If .htaccess cannot be written on Apache, the WordPress settings screen will show the rules but cannot save them to the file. mod_rewrite and AllowOverride configurations must also be correct.
Nginx does not read .htaccess; a suitable try_files rule is required in the server block. Copying the Apache example to the Nginx server does not provide a solution.
After migration, the document root, siteurl/home, subdirectory, and cache records may display the old path. URL correction should be done with a tool that will not affect the serialized data in the database.
Custom Post Type, page, category, and product slug conflicts can only create 404s in certain content types. If the rewrite flush is temporary and breaks again, the code's flush operation should be investigated.
Running flush_rewrite_rules in each request causes performance issues. Rewrite rules should only be updated once when the structure changes.
Search for the phrase you see in the email, browser, or SSH log. Each card includes meaning, probable cause, and safe initial action.
Meaning: The requested URL cannot be found by the web server or WordPress.
Possible cause: Rewrite missing, incorrect root or no actual content.
Meaning: WordPress is working but nice URLs are not being rewritten.
Possible cause: .htaccess, mod_rewrite or Nginx try_files.
Meaning: Apache did not redirect the request to index.php.
Possible cause: AllowOverride closed or no .htaccess rule.
Meaning: Nginx has searched the URL as a physical file.
Possible cause: try_files rule is not falling back to WordPress.
Meaning: Only taxonomy rewrite rule is broken.
Possible cause: Slug conflict, plugin, or base setting.
Meaning: The rewrite record of special content type is not up-to-date.
Possible cause: Code change post-flush not performed or slug conflict occurred.
Meaning: New server's rewrite/document root is different.
Possible cause: Missing vhost or .htaccess after transfer
Meaning: The server returns a 200 response when content is not found.
Possible cause: Theme is producing incorrect HTTP code.
No records matching this expression were found.
Commands are for root access. Collect only status and logs first; Do not change the permanent setting without seeing the reason.
wp rewrite flush --hard
WordPress rewrites rules and updates the .htaccess file if supported.
wp rewrite list --format=table | head -n 40
Displays the first matched rewrite rules.
curl -sSIk https://example.com/?p=1
curl -sSIk https://example.com/ornek-yazi/
It compares the clean URL with the nice URL using a plain query URL.
ls -la .htaccess
cat .htaccess
Displays the file's existence, owner, and current rules.
apachectl -M 2>/dev/null | grep rewrite
Indicates whether the mod_rewrite module is loaded.
wp option get home
wp option get siteurl
Verifies the primary URL values after migration.
The root cause of the WordPress error is the same, but log paths, PHP settings screens and service management vary depending on the hosting infrastructure used.
cPanel Apache/LiteSpeed environment prioritizes .htaccess and MultiPHP settings.
cd /home/KULLANICI/public_html && wp rewrite flush --hardPlesk's Apache & nginx Settings control document root and rewrite behavior.
plesk repair web example.comDirectly configure Apache AllowOverride or Nginx try_files on a panel-less server.
nginx -t 2>/dev/null || apachectl configtestVerify the content's existence, compare the query URL with the nice URL, and update the rewrite configuration suitable for the web server used.
Check that the post/page status is published and not in the trash.
wp post list --post_status=publish --fields=ID,post_title,post_nameIf ?p=ID is opening but slug is not, focus on the rewrite layer.
curl -sSIk https://example.com/?p=1Use Save from the panel or WP-CLI rewrite flush.
wp rewrite flush --hardCheck Apache .htaccess or Nginx try_files setting according to the used stack
apachectl -M 2>/dev/null | grep rewriteMake them unique if page, category, product, and CPT use the same slug.
wp rewrite listAfter clearing the application/CDN cache, rescan for real 404 codes.
curl -sSIk https://example.com/ornek-yazi/A Rewrite or .htaccess issue is highly likely.
wp rewrite flush --hardWooCommerce permalink, product base and slug conflict is checked.
wp option get woocommerce_permalinksCategory base, plugin rewrite filters, and pages with the same slug are examined.
wp term list categoryDocument root, home/siteurl, web server config, and cache records are checked.
wp option get siteurlNormaldir; Nginx does not read .htaccess. The server block try_files setting must be corrected.
nginx -T | grep -n 'try_files' | headWordPress works but the rewrite rule that redirects nice URLs to index.php does not work.
WordPress rewrites rules and writes to the .htaccess file in an appropriate environment.
No. For Nginx, a server block requires try_files or equivalent redirection.
For real removed pages, 404 is normal; however, accidentally serving 404 for existing important URLs can lead to traffic and index loss.
The content is displayed as not found even though the server returns a 200 successful code.
New document root, site URLs and web server rewrite configuration should be checked together.
The rewrite record of special content type, slug conflict or continuous flush code error may cause problems.
By analyzing cPanel, WHM, CloudLinux, LiteSpeed, MariaDB, Exim and security layers together, we fix the root cause of the failure instead of just removing the service.