Why every URL show 404 error except home page in Plesk?

Spread the love

If your website is hosted on Plesk and every URL show 404 error except the home page, just do the following.

  • Go to Hosting and DNS.
  • Go to Apache & nginx Settings
  • Go to Additional nginx directives
  • Then add the following code in the text field. and Save setting.


if (!-e $request_filename) {
set $test P;
}
if ($uri !~ ^/(plesk-stat|webstat|webstat-ssl|ftpstat|anon_ftpstat|awstats-icon|internal-nginx-static-location|status_phpfpm)) {
set $test "${test}C";
}
if ($test = PC) {
rewrite ^/(.*)$ /index.php?$1;
}

DNSindexLocationNginxPHPPleskSSLURL