Quản trị net diễn đàn chia sẻ thông tin các thủ thuật mạng, internet bảo mật thông tin dành cho giới IT VIệt hy vọng là nơi bổ ích cho cộng đồng

Quản trị net diễn đàn chia sẻ thông tin các thủ thuật mạng, internet bảo mật thông tin dành cho giới IT VIệt hy vọng là nơi bổ ích cho cộng đồng (http://quantrinet.com/forum/index.php)
-   Hướng dẫn sử dụng Plesk (http://quantrinet.com/forum/forumdisplay.php?f=195)
-   -   WordPress show "404 Not Found" (http://quantrinet.com/forum/showthread.php?t=10305)

hoctinhoc 27-12-2021 08:08 PM

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:


Bây giờ là 10:22 PM. Giờ GMT +7

Diễn đàn tin học QuantriNet
quantrinet.com | quantrimang.co.cc
Founded by Trương Văn Phương | Developed by QuantriNet's members.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.