Applicable to:
- Plesk Onyx for Linux
- Plesk for Linux
Symptoms
-
Unable to access domain's web statistics page at
https://www.example.com/plesk-stat/webstat/
: it gets redirected to domain main page, or shows error:CONFIG_TEXT: 404 not found
-
One of the following nginx directive is defined under Plesk > Domains > example.com > Apache and nginx Settings > Additional nginx directives:
CONFIG_TEXT: if (!-e $request_filename){
rewrite ^(.*)$ /index.php break;
}
CONFIG_TEXT: if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
} -
PHP handler is set to FPM by Nginx under Plesk > Domains > example.com > PHP settings.
Cause
Additional nginx directives prevents accessto Web Statistics page
Resolution
-
Go to Domains > example.com > Apache & nginx Settings
-
Replace the additional directive with the following:
CONFIG_TEXT: if (!-e $request_filename ){
set $test P;
}
if ($uri !~ ^/(plesk-stat|webstat|webstat-ssl|ftpstat|anon_ftpstat|awstats-icon)){
set $test "${test}C";
}
if ($test = PC){
rewrite ^ /server/index.php last;
} -
If the directive above fixes the issue with Web Statistics page, but makes some links on a site broken, use the following additional directives instead:
CONFIG_TEXT: if (!-e $request_filename ){
set $test P;
}
if ($uri !~ ^/(plesk-stat|webstat|webstat-ssl|ftpstat|anon_ftpstat|awstats-icon)){
set $test "${test}C";
}
if ($test = PC){
rewrite ^/(.*)$ /index.php?q=$1 last;
}
If additional directives are not required for website functioning, remove them under Plesk > Domains > example.com > Apache and nginx Settings .
Comments
4 comments
Hi,
I use the WoltLab Suite 3.1 (Community software with forum, gallery (photos), blog, ..). For WoltLab rewriting we had to use the following rules the last two years in additional nginx settings - I use ONLY Nginx, no Apache:
if (!-e $request_filename)
{
rewrite ^/(forum/|photos/|cloud/|shop/|blog|calendar|chat/)?(.+)$ /$1index.php?$2 last;
}
I tried to merge it with your code. But without success.
Perhaps do you know how to configure the rules that WoltLab links and apps are shown and also the plesk webstats.
Thanks a lot
@Markus Wernecke,
Hello,
Unfortunately, I cannot provide you with a solution as I'm not familiar with WoltLab and cannot guarantee that rewrite rules will correctly.
However, I have found that a similar question was discussed on WoltLab forum
You may ask this question on Plesk forum as well, maybe other Pleskians faced it already and will be able to help you.
Whatever I try still not working, 404 on some WP and some Joomla sites and rest of sites are working fine! how to solve this 404 issue with some Joomla and some WP sites?
Hi Fouad Ahmed Fouad, this article is for https://www.example.com/plesk-stat/webstat/. Please open a support ticket with us so we can work on it.
Please sign in to leave a comment.