View Single Post
Tuổi 27-12-2021, 08:08 PM   #1
hoctinhoc
Guest
 
Trả Lời: n/a
WordPress show "404 Not Found"
Website pages based on WordPress show "404 Not Found" when PHP-FPM by Nginx and Proxy Mode are used




Symptoms

  • Website pages based on WordPress show below error on all pages except the main one:
    404 Not Found
    when:
    • FPM application served by nginx is set in Domains > example.com > PHP Settings
    • Proxy Mode is enabled at Domains > example.com > Apache & nginx Settings.
    • Non Plain is set in WordPress Dashboard > Settings > Permalinks type
  • WordPress REST API point (wp-api) shows 404 error. It can be checked by accessing http://example.com/wp-json/wp/v2/posts
Cause

WordPress detects that php files are handled by Nginx and doesn't generate .htaccess file. At the same time permalinks continues to be served by Apache when Proxy mode is enabled.
Since .htaccess with Apache rewrite rules doesn't exist WordPress shows 404 error for pages.
The behavior that PHP continues to be served by Apache when Proxy mode is enabled is caused by a bug with the ID #PPPM-11234, which is planned to be fixed in future Plesk updates.
Resolution

One of below workarounds can be used:
  Trả lời ngay kèm theo trích dẫn này