Arama Yap Mesaj Submit
Request a Callback
+90
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro

Contact Us

Location Halkali merkez neighborhood fatih st ozgur apt no 46 , Kucukcekmece , Istanbul , 34303 , TR
WordPress Technical Guide

WordPress Pages 404 Error: Permalink and .htaccess Solution

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 FoundPermalinkhtaccessmod_rewriteNginx try_files
root@server:~SSH
404 Not Found
The requested URL was not found on this server
nginx: open() /var/www/html/ornek-yazi failed
WordPress LayerKernel, theme and plugin behavior.
PHP layerVersion, extension, limit, and fatal error
Server layerWeb service, database, disk, and logs
Secure MethodBackup, log, isolate, and verify
01
Technical description

Why does a 404 error occur for a permanent link in WordPress?

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.

02
Log messages and their meanings

WordPress 404, rewrite and permalink error messages

Search for the phrase you see in the email, browser, or SSH log. Each card includes meaning, probable cause, and safe initial action.

8 registration
01warning

404 Not Found

Meaning: The requested URL cannot be found by the web server or WordPress.

Possible cause: Rewrite missing, incorrect root or no actual content.

Compare home page and ?p=ID format.
02warning

Home page opens, other pages 404

Meaning: WordPress is working but nice URLs are not being rewritten.

Possible cause: .htaccess, mod_rewrite or Nginx try_files.

Re-save permanent links and check web config.
03warning

The requested URL was not found on this server

Meaning: Apache did not redirect the request to index.php.

Possible cause: AllowOverride closed or no .htaccess rule.

Verify Apache vhost and .htaccess permissions.
04warning

Nginx static file 404

Meaning: Nginx has searched the URL as a physical file.

Possible cause: try_files rule is not falling back to WordPress.

check the location / settings in the server blog.
05warning

Category or tag 404

Meaning: Only taxonomy rewrite rule is broken.

Possible cause: Slug conflict, plugin, or base setting.

Review taxonomy base and conflicting pages.
06warning

Custom post type 404

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.

Verify CPT registration and refresh rewrite once.
07warning

All internal pages 404 after migration

Meaning: New server's rewrite/document root is different.

Possible cause: Missing vhost or .htaccess after transfer

Verify new web server rules and root directory.
08warning

Soft 404

Meaning: The server returns a 200 response when content is not found.

Possible cause: Theme is producing incorrect HTTP code.

Check if the real non-existent URL returns a 404 code.

No records matching this expression were found.

03
Secure first review

SSH diagnostic commands and what output to look for?

Commands are for root access. Collect only status and logs first; Do not change the permanent setting without seeing the reason.

Refresh permanent link
wp rewrite flush --hard

WordPress rewrites rules and updates the .htaccess file if supported.

View Rewrite structure
wp rewrite list --format=table | head -n 40

Displays the first matched rewrite rules.

URL comparison
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.

htaccess control.
ls -la .htaccess
cat .htaccess

Displays the file's existence, owner, and current rules.

Apache mod_rewrite
apachectl -M 2>/dev/null | grep rewrite

Indicates whether the mod_rewrite module is loaded.

Site URL values
wp option get home
wp option get siteurl

Verifies the primary URL values after migration.

04
By hosting environment

Controls to be applied on cPanel, Plesk and panelless server

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 / WHM

cPanel Apache/LiteSpeed environment prioritizes .htaccess and MultiPHP settings.

  • Show hidden files in the File Manager and back up the .htaccess file.
  • In the Permanent Links screen, press Save without making any changes.
  • Verify the addon domain document root path.
cd /home/KULLANICI/public_html && wp rewrite flush --hard

Plesk Obsidian

Plesk's Apache & nginx Settings control document root and rewrite behavior.

  • Verify the domain root directory's httpdocs or custom path.
  • Check Nginx proxy mode and additional directives.
  • If necessary, recreate the domain web config using repair.
plesk repair web example.com

Panel-less Linux Server

Directly configure Apache AllowOverride or Nginx try_files on a panel-less server.

  • Verify mod_rewrite and AllowOverride All settings in Apache.
  • Use Nginx location / with try_files $uri $uri/ /index.php?$args in it.
  • Reload the service after the config test.
nginx -t 2>/dev/null || apachectl configtest
05
Safe solution order

Steps to resolve WordPress 404 and permanent link errors

Verify the content's existence, compare the query URL with the nice URL, and update the rewrite configuration suitable for the web server used.

1

Verify that the content actually exists.

Check that the post/page status is published and not in the trash.

wp post list --post_status=publish --fields=ID,post_title,post_name
2

Compare the query URL with the beautiful URL.

If ?p=ID is opening but slug is not, focus on the rewrite layer.

curl -sSIk https://example.com/?p=1
3

Refresh permanent links once

Use Save from the panel or WP-CLI rewrite flush.

wp rewrite flush --hard
4

Verify the web server rule

Check Apache .htaccess or Nginx try_files setting according to the used stack

apachectl -M 2>/dev/null | grep rewrite
5

Examine slug and content type conflicts.

Make them unique if page, category, product, and CPT use the same slug.

wp rewrite list
6

Verify Cache and Search Console results

After clearing the application/CDN cache, rescan for real 404 codes.

curl -sSIk https://example.com/ornek-yazi/
06
Distinction by symptom

Special scenarios and decision trees

Home page opens, all posts 404

A Rewrite or .htaccess issue is highly likely.

wp rewrite flush --hard
Only 404 products

WooCommerce permalink, product base and slug conflict is checked.

wp option get woocommerce_permalinks
Single categories 404

Category base, plugin rewrite filters, and pages with the same slug are examined.

wp term list category
Started after migration

Document root, home/siteurl, web server config, and cache records are checked.

wp option get siteurl
Nginx on the server .htaccess is not changing

Normaldir; Nginx does not read .htaccess. The server block try_files setting must be corrected.

nginx -T | grep -n 'try_files' | head

Absolutely don't

  • Do not run rewrite flush on each page request.
  • Do not expect a solution with .htaccess on the Nginx server.
  • Change the URL using plain SQL replace and do not corrupt the serialized data.
  • Do not return the real 404 page with a 200 code.
  • Backup SEO 301 records before removing all redirects.
  • Do not move files to another directory without verifying the document root.

Post-solution verification

  • Home, post, page, category, and product URLs are opening.
  • The fake URL is returning a 404 code.
  • Query URL and pretty URL show the same content.
  • New .htaccess or Nginx config is being tested.
  • Redirect Chain is not formed.
  • Search Console sitemap URLs are being crawled with correct canonical.
07
Official technical resources

WordPress and WP-CLI official documentation

08
Internal SEO content set

Related WordPress error solutions

09
Frequently asked questions

WordPress 404 and Permalink Curiosities about

Why do other pages give 404 while the home page opens?

WordPress works but the rewrite rule that redirects nice URLs to index.php does not work.

What does saving permanent links do?

WordPress rewrites rules and writes to the .htaccess file in an appropriate environment.

Does Nginx use .htaccess?

No. For Nginx, a server block requires try_files or equivalent redirection.

Do 404 errors affect SEO?

For real removed pages, 404 is normal; however, accidentally serving 404 for existing important URLs can lead to traffic and index loss.

What is Soft 404?

The content is displayed as not found even though the server returns a 200 successful code.

How to fix 404 after migration?

New document root, site URLs and web server rewrite configuration should be checked together.

CPT 404 why it keeps repeating?

The rewrite record of special content type, slug conflict or continuous flush code error may cause problems.

EKA SOFTWARE AND INFORMATION SYSTEMS

Let's fix the error on your server permanently

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.

Get Server Support WhatsApp
Top