meymigrou
New Pleskian
After I enabled NGINX from Plesk (Web Pro) all my posts in my main and sub-directory blogs give 404 Page Not Found error.
I placed the following code in my "Additional NGINX Directives" in Plesk to fix all the URLS, but it only fixed the main site (example.com) while the sub-directory blogs (example.com/tech/, example.com/mag/ and example.com/dispatch/) are still giving 404 error.
After that, I removed the code and placed the following one:
I found this code in one of the official Plesk pages, and it says:
As of now I got this (which doesn't work):
Any help will be much appreciated!
P.S. The main website works like a charm. In example.com/tech/ and /mag/ and /dispatch/ while the homepages are fine, the posts are giving me a 404 page error. I also updated the permalinks in WordPress and it didn't help.
I placed the following code in my "Additional NGINX Directives" in Plesk to fix all the URLS, but it only fixed the main site (example.com) while the sub-directory blogs (example.com/tech/, example.com/mag/ and example.com/dispatch/) are still giving 404 error.
Code:
# Wordpress Permalinks
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
After that, I removed the code and placed the following one:
Code:
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;
}
I found this code in one of the official Plesk pages, and it says:
If a WordPress installation is located in a subdirectory (for example, "httpdocs/sub-dir") or this is a WordPress multisite network based on subdirectories, add the /sub-dir/ before /index.php?$1 so it will look like this: rewrite ^/(.*)$ /sub-dir/index.php?$1;
Note: For WordPress multisite network based on subfolder, add the above rule for each subdirectory.
As of now I got this (which doesn't work):
Code:
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;
rewrite ^/(.*)$ /tech/index.php?$1;
rewrite ^/(.*)$ /mag/index.php?$1;
rewrite ^/(.*)$ /dispatch/index.php?$1;
}
Any help will be much appreciated!
P.S. The main website works like a charm. In example.com/tech/ and /mag/ and /dispatch/ while the homepages are fine, the posts are giving me a 404 page error. I also updated the permalinks in WordPress and it didn't help.