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 Rewrite Rules and Permalinks

Why Do WordPress Permalinks Return 404 Errors?

When the WordPress home page opens but posts, pages, products, or custom content URLs return 404, it is usually caused by missing rewrite rules, the `.htaccess` file not being read, an incorrect subdirectory path, or plugins breaking the managed WordPress rewrite block.

WordPress 404Permalinkmod_rewriteRewriteBaseWooCommerce
Apache/LiteSpeed Diagnostics
404 Not Found
The requested URL was not found on this server
WordPress permalinks not working
Rewrite rules flushed
.htaccess is not writable
01Verify file and document root
02Take a backup and read the error log
03Separate server and application context
04Verify live result with curl
01
Safe technical approach

WordPress Permalink 404 How to analyze?

When the WordPress home page opens but posts, pages, products, or custom content URLs return 404, it is usually caused by missing rewrite rules, the `.htaccess` file not being read, an incorrect subdirectory path, or plugins breaking the managed WordPress rewrite block.

01

Determine server type

Do not expect a `.htaccess` result without reserving the Apache, LiteSpeed, Plesk proxy or NGINX-only structure.

02

Get backup and logs

Back up the current file with the date; Find the directive and line in the Apache/LiteSpeed error log.

03

Change one rule

Do not change redirect, rewrite, header and access rules all at the same time.

04

Test from outside

Measure the status, Location, Content-Type and redirect number with curl and check the cache layers separately.

Do not randomly mix plugin code with the WordPress managed rewrite block.

02
Live problem dictionary

Apache, redirect and access messages

01kritik

Home page opens, posts 404

Meaning: The front-controller rewrite is not being applied.

Possible cause: The WordPress block is missing or mod_rewrite is disabled.

02warning

.htaccess is not writable

Meaning: WordPress cannot automatically write rules to the file.

Possible cause: Ownership or file permission.

03warning

WooCommerce products return 404

Meaning: Product rewrite rules are outdated.

Possible cause: Slug change, migration, or cache.

04warning

Custom post type 404

Meaning: The rewrite registration for the new content type has not been refreshed.

Possible cause: No flush after plugin or theme activation.

05warning

Subfolder WordPress 404

Meaning: The RewriteBase or index.php path is set as a root installation.

Possible cause: WordPress is in the `/blog` subdirectory.

06warning

Multisite 404

Meaning: No rules suitable for the network type.

Possible cause: Subdomain and subdirectory rules are mixed.

07warning

Old 404 after LiteSpeed Cache

Meaning: Cache layer holds the old route result.

Possible cause: Object/page/CDN cache.

08bilgi

No .htaccess on NGINX

Meaning: WordPress rewrite should be done with NGINX `try_files`.

Possible cause: NGINX-only hosting.

No records matching this expression were found.

03
Copiable controls

curl, Apache log and file tests

WordPress rewrite flush

wp rewrite flush --hard

Refreshes the rewrite rules with WP-CLI and updates the `.htaccess` file in supported environments.

Rewrite structure

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

Shows the active permalink structure and initial rewrite rules.

File permissions

stat -c '%a %U:%G %n' .htaccess wp-config.php index.php 2>/dev/null || stat -f '%Lp %Su:%Sg %N' .htaccess wp-config.php index.php

Shows the ownership and permissions of critical WordPress files.

mod_rewrite

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

Check if Apache rewrite module is loaded.

Example URL test

curl -sS -o /dev/null -w 'HTTP:%{http_code} Final:%{url_effective}\n' -L https://example.com/ornek-yazi/

Displays the HTTP result of a permalink URL.

WordPress URL settings

wp option get home && wp option get siteurl && wp option get permalink_structure

Shows the Home URL, Site URL, and permalink structure.

04
Correct and incorrect structure

.htaccess rule comparisons

Root installation

Risky / Incorrect
RewriteRule ^ index.php [L]
Right Approach
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Subfolder installation

Risky / Incorrect
RewriteBase /
RewriteRule . /index.php [L]
Right Approach
RewriteBase /blog/
RewriteRule . /blog/index.php [L]

Protecting real files

Risky / Incorrect
RewriteRule . /index.php [L]
Right Approach
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

NGINX equivalent

Risky / Incorrect
RewriteEngine On
RewriteRule . /index.php [L]
Right Approach
location / {
    try_files $uri $uri/ /index.php?$args;
}
05
Application by infrastructure

Apache, cPanel, Plesk, LiteSpeed and applications

WordPress / WooCommerce

Permalink registration, custom post types, and product slugs should be examined together.

  • Save Settings > Persistent Connections screen once.
  • Check for slug conflicts.
  • Separate the blocks of security and cache plugins.

cPanel / LiteSpeed

The WordPress root and LiteSpeed cache rules inside public_html are important.

  • Verify the actual root using WP Toolkit or File Manager.
  • Purge the LiteSpeed Cache.
  • Keep the file ownership compatible with the PHP user.

Plesk / NGINX / WISECP Co-Installation

WordPress may be on a subdirectory or subdomain; if NGINX-only, `.htaccess` has no effect.

  • Verify the Plesk WordPress Toolkit root.
  • Use the NGINX `try_files` directive.
  • Do not create a front-controller conflict in the same root as WISECP.
Incorrect interventions

Absolutely don't

  • Do not randomly mix plugin code with the WordPress managed rewrite block.
  • Do not delete the database or posts to fix a permalink error.
  • Do not set 777 permissions to make the file writable.
  • Do not assume WordPress `.htaccess` code is the solution on an NGINX-only site.
Post-procedure check

Verify the solution

  • Home, post, page, category, and product URLs return 200.
  • Static files are not unnecessarily routed through WordPress index.php.
  • The permalink structure is compatible with canonical and sitemap URLs.
  • No new 404 is created after cache clearing.
06
Internal SEO content set

Related .htaccess solutions

07
primary sources

Apache, WordPress and panel documentation

08
Frequently asked questions

WordPress Permalink 404 Curiosities about

Does the WordPress Permalink 404 rule work on NGINX?

No. NGINX does not read `.htaccess` files. The rule must be translated to a `server` or `location` configuration.

Is Apache restart required for .htaccess changes?

Usually not; Apache evaluates the `.htaccess` file on each request. However, a reload or restart is required for VirtualHost, module, or AllowOverride changes.

What should be done before editing the file?

A dated backup of the existing file should be taken, the active document root verified, and the change tested on staging or during low-traffic periods.

Where is the file located in Plesk with cPanel?

In cPanel it is usually inside `public_html`, in Plesk inside `httpdocs`; addon domains and subdomains may have a different document root.

Does LiteSpeed support `.htaccess` rules?

LiteSpeed supports most rules through Apache compatibility; some module and handler behaviors may differ.

Where should I look first in case of a 500 error?

Full directive and line record in Apache/LiteSpeed error log. The file should be restored according to the log instead of being deleted randomly.

Can these codes be added directly to the live site?

Domain should not be added directly without verifying domain, document root, proxy, WordPress, and server structure. Examples should be adapted and tested.

EKA SOFTWARE AND INFORMATION SYSTEMS

Let's edit .htaccess and Apache rules without making the site inaccessible

We examine redirection, rewrite, CORS, access and 500 errors with logs in cPanel, Plesk, LiteSpeed, WordPress, custom PHP and WISECP structures.

Get Server SupportWhatsApp
Top