• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue Rewrite subfolder nginx

Marcio Nunes

Basic Pleskian
Hi,
We need to develop some website multi language. Example: /en and /es

When install new Joomla or WordPress in subfolders, don't work the rewrite URL nginx. Show 404 in URL /en/anycontent

Joomla and WordPress have support to multi language, but in this situation, need new web (components specific don't support multi currency, USD and EUR).

How fix? What's directive nginx can use to work URL rewrite for all subfolder?

Thanks
 
Marcio I really hope you solved your situation by now, but I run into your topic and there's no solution yet. I ran into a comparable issue.

I'm going to
1) explain my situation
2) explain the solution

I had a site at domain
a WP domain/sub1
multple WPs at domain/sub1/sub2

So I needed a regex which allows for all three possibilities.
Here's the edited standard

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 ^((/\w+/)?(\w+)?)?(.*)$ $2$3/index.php?$4;

}


So it makes the subdomain and subsubdomain optional and saves them in variables by group capture.

this works for domain and subsubdomain but not subdomain.

Obviously it can't tell the difference between

domain/sub1/hello-world

and

domain/sub1/sub2

Maybe that's just not possible. I 'solved' the issue by moving all from the subfolder to the sub subfolder (nvm the nomenclature and conflagration between subdomain and folder)

For single-dept subdomains, I think you should use

rewrite ^(/\w+/?)?(.*)$ $1/index.php?$2;
 
Last edited:
Back
Top