Nginx Wordpress Permalinks 404 Error Page Not Found


Nginx make sites faster. But, Nginx causes WordPress permalinks 404 errors. This happens as Apache’s rewrite rules do not work with NGINX.  On this post we will learn to WordPress permalinks in Nginx.
WordPress pretty permalinks optimized to be SEO friendly and are compatible with the most popular web servers:
Apache: using mod_rewrite module.Nginx: using try-files.Lighttpd: using mod_rewrite or a 404 handler.Microsoft IIS 7+ using URL Rewrite 1.1+ module and PHP 5 running as FastCGIMicrosoft IIS 6+ working with ASAPI_Rewrite or Ionic ISAPI Rewriting Filter (IIRF) Why Nginx WordPress permalinks 404 error Page not found? Technically, anyone who choose PHP-FPM as the PHP handler, as WordPress recommends. And, to take advantage of NGINX, i recommend to enable PHP-FPM on all domains that serve PHP.
Unfortunately, mod_security rules will not work with Nginx, and .htaccess rewrite rules and restrictions will no longer apply. Nginx and Apache rewrite rules have totally different format. The directives in Apache like Rewritecond, RewriteRule and more take its tolls in Nginx configuration. This means that WordPress permalink rewrites will no longer work after switching to Nginx.
Fixing Nginx WordPress permalinks 404 error Page not found We can set our really cool permalink configuration directly by editing Nginx. We will use try_files directive so WordPress can start using pretty permalinks. Let’s see the configuration for WordPress installed on the root of your domain.
Search for the location / block inside nginx configuration and add the following line inside:
location / { # WordPress permalinks in Nginx try_files $uri $uri/ /index.php?$args; } On this code, we are letting Nginx checking the existance of a file at the URL usign $uri, then it searches for directory ($uri/), and if it doesn’t find any of both, it will make an internal redirect to /index.php with the arguments from the query string as parameters.
After editing, save your file, and reload Nginx to apply changes:
service nginx reload or
systemctl reload nginx.service Alternatively, in servers with Plesk control panel, we just had to add the rules in the “Additional Nginx directives” section inside the domain settings at Domains > example.com > Apache & nginx Settings. That fixed the permalinks and the website started working again.
if (!-e $request_filename) {
set $test P;
}
if ($uri !~ ^/(plesk-stat|webstat|webstat-ssl|ftpstat|anon_ftpstat|awstats-icon|internal-nginx-static-location)) {
set $test "${test}C";
}
if ($test = PC) {
rewrite ^/(.*)$ /index.php?$1;
} On the other hand, in servers with CPanel. Please bear in mind that Nginx configuration file refers to the user’s config file at this location where $USERNAME represents the username:

/etc/nginx/conf.d/users/$USERNAME.conf Next, you need to add this snipprt to the config file above: (/wordpress here refers where the WordPress installation is configured to be available)

location /wordpress { try_files $uri $uri/ /wordpress/index.php?$args; location ~ \.php7?$ { include conf.d/includes-optional/cpanel-fastcgi.conf; fastcgi_pass unix:/opt/cpanel/ea-php73/root/usr/var/run/php-fpm/1ed179754201ac2644e8c70140bacb23c7786484.sock; error_page 502 503 /FPM_50x.html; } }
Finally, you restart Nginx gracefully by running this command:
/scripts/restartsrv_nginx Conclusion Nginx wordpress permalinks 404 error page not found occurs when the rewrite rules do not follow the Nginx format. The fix involves converting the rules and modifying Nginx configuration.
The post Nginx WordPress permalinks 404 error Page not found appeared first on Wordpress Tip Guide Support Solution.


Artikel ini hanyalah simpanan cache dari url asal penulis yang berkebarangkalian sudah terlalu lama atau sudah dibuang :

https://www.jonloh.com/nginx-wordpress-permalinks-404-error-page-not-found/

Kempen Promosi dan Iklan
Kami memerlukan jasa baik anda untuk menyokong kempen pengiklanan dalam website kami. Serba sedikit anda telah membantu kami untuk mengekalkan servis percuma aggregating ini kepada semua.

Anda juga boleh memberikan sumbangan anda kepada kami dengan menghubungi kami di sini
Fallen Truck Pulled From River But Victim Not Found

Fallen Truck Pulled From River But Victim Not Found

papar berkaitan - pada 14/8/2021 - jumlah : 266 hits
SAR team pulls the vehicle out from the water SIBU The Search and Rescue team has found the pick up truck which fell from Batang Lassa bridge in Daro yesterday morning Matu Daro police chief DSP Neil Beginda said the team managed to pull
Agong S Signature Not Essential For Revocation Of Ordinances Says Former Top Judge

Agong S Signature Not Essential For Revocation Of Ordinances Says Former Top Judge

papar berkaitan - pada 31/7/2021 - jumlah : 237 hits
A prominent former Federal Court judge says it is not essential for the Yang di Pertuan Agong to sign off on a Cabinet decision to revoke the emergency ordinances in what could be a constitutional solution to the current stalemate sparked b...
Dun Members Should Not Be Paid During Emergency Extension Period Pbk

Dun Members Should Not Be Paid During Emergency Extension Period Pbk

papar berkaitan - pada 1/8/2021 - jumlah : 282 hits
Voon Lee Shan KUCHING All Sarawak State Legislative Assembly members should not be paid their salaries and allowances from Aug 2 in line with the extension of the Emergency in the state until Feb 2 next year said Parti Bumi Kenyalang P
Overcrowding At Ppv Will Not Happen Again Says Citf

Overcrowding At Ppv Will Not Happen Again Says Citf

papar berkaitan - pada 30/7/2021 - jumlah : 344 hits
The massive overcrowding involving foreign workers outside the Kuala Lumpur Convention Centre vaccination centre yesterday PETALING JAYA The Covid 19 Immunisation Task Force has assured that overcrowding involving foreign workers at vaccina...
Cops Urge Employers Not To Send Workers Too Early For Jabs

Cops Urge Employers Not To Send Workers Too Early For Jabs

papar berkaitan - pada 29/7/2021 - jumlah : 334 hits
KUALA LUMPUR Police have urged employers not to send their staff too early to the vaccination centres in order to avoid overcrowding This comes after images and videos went viral on social media and WhatsApp of long queues and large crowds ...
Let S Not Let Our Freedoms Backslide

Let S Not Let Our Freedoms Backslide

papar berkaitan - pada 28/7/2021 - jumlah : 273 hits
On Monday my heart swelled with pride as I saw junior contract doctors stand up for their rights to express themselves by participating in a brief called by the Hartal Doktor Kontrak Here were government contract doctors at around 20 hospit...
Malaysia Is Not Too Far Behind In The Fight Against Covid 19

Malaysia Is Not Too Far Behind In The Fight Against Covid 19

papar berkaitan - pada 29/7/2021 - jumlah : 291 hits
The good news is Malaysia is not too far behind in performance The bad news is even if 100 of Malaysians have been vaccinated this does not mean Covid 19 will go away It is still going to be with us Hence our task now is to learn how to liv...
The King And Anwar Ibrahim They Did Not Meet But

The King And Anwar Ibrahim They Did Not Meet But

papar berkaitan - pada 1/8/2021 - jumlah : 251 hits
Port Klang Sat It was clear that those supporting those in government who are desperately hanging on to power were the ones most affected by talk earlier today that Opposition leader Anwar Ibrahim was meeting the King The reason was quite c...
Support Our Women Athletes Not Condemn Their Outfit Zuraida

Support Our Women Athletes Not Condemn Their Outfit Zuraida

papar berkaitan - pada 1/8/2021 - jumlah : 305 hits
Amid the fervour for the ongoing Tokyo Olympics Housing and Local Government Minister Zuraida Kamaruddin has urged Malaysians to support the country s athletes instead of condemning what they are wearing This comes following a viral social ...
Siti Kasim Pas Loyalists Are Fools If They Fall For The Jihad Fundraising Drive To Save Siti Mastura S Skin

Ditch The Cubicle Your Home Office Guide

Kemalangan Di Lebuh Raya Utara Selatan Enam Mangsa Maut

Scammer Di Facebook

Apa Kuasa Myeg Ke Atas Worldcoin

Major Projects Will Make Sarawak An Asian Economic Force Says Premier

Final Call The Huawei Service Giving Season Ends On 31 December 2024

Petua Kesihatan Untuk Orang Yang Sudah Berusia


echo '';
Info Dan Sinopsis Drama Berepisod Curang Tanpa Niat Slot Megadrama Astro Ria

5 Insiden Jalan Sesak Yang Berlaku Lebih 24 Jam Durasinya

Senarai Lagu Tugasan Konsert Minggu 6 Gegar Vaganza 2024 Musim 11

Keputusan Markah Peserta Konsert Minggu 5 Gegar Vaganza 2024 Musim 11

10 Filem Drama Seram Melayu Berhantu Terbaru 2024 2025 Mesti Tonton


Raih Gigi Putih Alami Dengan 7 Bahan Sederhana Ini

5 Rahasia Mata Sehat Yang Direkomendasikan Pakar Mata

7 Tanda Kerusakan Otak Yang Kerap Dianggap Remeh

Kawal Alergik Bila Alahan

Petua Kesihatan Untuk Orang Yang Sudah Berusia

Indah Delvia Tacilak Di Nan Rami Chord