3 Code formatting
source | link

II've faced the same error. I've with both Nginx and Apache installed. Nginx works as a reverse proxy and serves static files. Due toBecause of this reason, you have to insert the following code inside server directive:

if ( !-e $request_filename ) {
        rewrite /wp-admin$ $scheme://$host$uri/ permanent;  
        rewrite ^(/[^/]+)?(/wp-.*) $2 last;                     
        rewrite ^(/[^/]+)?(/.*\.php) $2 last;                   
    }

If you use Nginx as reverse proxy for static files you have to put the code listed above inside a location. i.e:

    location ~ ^.+\.(jpg|jpeg|gif|png|webp|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js|JPG|JPEG|GIF|PNG|ICO|CSS|ZIP|TGZ|GZ|RAR|BZ2|DOC|XLS|EXE|PDF|PPT|TXT|TAR|WAV|BMP|RTF|JS) {
if ( !-e $request_filename ) {
                rewrite /wp-admin$ $scheme://$host$uri/ permanent;
                rewrite ^(/[^/]+)?(/wp-.*) $2 last;
                rewrite ^(/[^/]+)?(/.*\.php) $2 last;
        }

If you run nginx + php-fpm (no Apache and further url rewriting with mod_rewritemod_rewrite involved) you have to put the code inside server directive

Hope this helps.

I faced the same error. I've both Nginx and Apache installed. Nginx works as a reverse proxy and serves static files. Due to this reason, you have to insert the following code inside server directive:

if (!-e $request_filename) {
        rewrite /wp-admin$ $scheme://$host$uri/ permanent;  
        rewrite ^(/[^/]+)?(/wp-.*) $2 last;                     
        rewrite ^(/[^/]+)?(/.*\.php) $2 last;                   
    }

If you use Nginx as reverse proxy for static files you have to put the code listed above inside a location. i.e:

    location ~ ^.+\.(jpg|jpeg|gif|png|webp|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js|JPG|JPEG|GIF|PNG|ICO|CSS|ZIP|TGZ|GZ|RAR|BZ2|DOC|XLS|EXE|PDF|PPT|TXT|TAR|WAV|BMP|RTF|JS) {
if (!-e $request_filename) {
                rewrite /wp-admin$ $scheme://$host$uri/ permanent;
                rewrite ^(/[^/]+)?(/wp-.*) $2 last;
                rewrite ^(/[^/]+)?(/.*\.php) $2 last;
        }

If you run nginx + php-fpm (no Apache and further url rewriting with mod_rewrite involved) you have to put the code inside server directive

Hope this helps.

I've faced the same error with both Nginx and Apache installed. Nginx works as a reverse proxy and serves static files. Because of this reason you have to insert the following code inside server directive:

if ( !-e $request_filename ) {
    rewrite /wp-admin$ $scheme://$host$uri/ permanent;  
    rewrite ^(/[^/]+)?(/wp-.*) $2 last;                     
    rewrite ^(/[^/]+)?(/.*\.php) $2 last;                   
}

If you use Nginx as reverse proxy for static files you have to put the code listed above inside a location. i.e:

location ~ ^.+\.(jpg|jpeg|gif|png|webp|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js|JPG|JPEG|GIF|PNG|ICO|CSS|ZIP|TGZ|GZ|RAR|BZ2|DOC|XLS|EXE|PDF|PPT|TXT|TAR|WAV|BMP|RTF|JS) {
if ( !-e $request_filename ) {
    rewrite /wp-admin$ $scheme://$host$uri/ permanent;
    rewrite ^(/[^/]+)?(/wp-.*) $2 last;
    rewrite ^(/[^/]+)?(/.*\.php) $2 last;
}

If you run nginx + php-fpm (no Apache and further url rewriting with mod_rewrite involved) you have to put the code inside server directive.

2 Add specifications based upon webserver config
source | link

I faced the same error. I've both Nginx and Apache installed. Nginx works as a reverse proxy and serves static files. Due to this reason, you have to insert the following directivescode inside server directive:

The final .confIf you use Nginx as reverse proxy for static files shoul be similaryou have to this (change your path accordingly)put the code listed above inside a location. i.e:

server {
        ##DM - uncomment following line for domain mapping  
        #listen 80 default_server;
    server_namelocation example.com~ *^.example+\.com(jpg|jpeg|gif|png|webp|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js|JPG|JPEG|GIF|PNG|ICO|CSS|ZIP|TGZ|GZ|RAR|BZ2|DOC|XLS|EXE|PDF|PPT|TXT|TAR|WAV|BMP|RTF|JS) ;{
    ##DMif (!- uncomment following line for domain mapping
    #server_name_in_redirect off;

    access_log   /var/log/nginx/example.com.access.log;
    error_log    /var/log/nginx/example.com.error.log;

   e root$request_filename) /var/www/example.com/htdocs;{
    index index.php;

    if (!-e $request_filename) {
        rewrite /wp-admin$ $scheme://$host$uri/ permanent; 
  
               rewrite ^(/[^/]+)?(/wp-.*) $2 last;              
        
         rewrite ^(/[^/]+)?(/.*\.php) $2 last;                   
    }

    location / {
        try_files $uri $uri/ /index.php?$args ;
    }

    location ~ \.php$ {
        try_files $uri =404;
        include fastcgi_params;
        fastcgi_pass 127.0.0.1:9000;
    }

    location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
        access_log off; log_not_found off; expires max;
    }

    location = /robots.txt { access_log off; log_not_found off; }
    location ~ /\. { deny  all; access_log off; log_not_found off; }
}

If you run nginx + php-fpm (no Apache and further url rewriting with mod_rewrite involved) you have to put the code inside server directive

I faced the same error. I've both Nginx and Apache installed. Nginx works as a reverse proxy and serves static files. Due to this reason, you have to insert the following directives inside server directive:

The final .conf files shoul be similar to this (change your path accordingly):

server {
        ##DM - uncomment following line for domain mapping  
        #listen 80 default_server;
    server_name example.com *.example.com ;
    ##DM - uncomment following line for domain mapping
    #server_name_in_redirect off;

    access_log   /var/log/nginx/example.com.access.log;
    error_log    /var/log/nginx/example.com.error.log;

    root /var/www/example.com/htdocs;
    index index.php;

    if (!-e $request_filename) {
        rewrite /wp-admin$ $scheme://$host$uri/ permanent;  
         rewrite ^(/[^/]+)?(/wp-.*) $2 last;                     
         rewrite ^(/[^/]+)?(/.*\.php) $2 last;                   
    }

    location / {
        try_files $uri $uri/ /index.php?$args ;
    }

    location ~ \.php$ {
        try_files $uri =404;
        include fastcgi_params;
        fastcgi_pass 127.0.0.1:9000;
    }

    location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
        access_log off; log_not_found off; expires max;
    }

    location = /robots.txt { access_log off; log_not_found off; }
    location ~ /\. { deny  all; access_log off; log_not_found off; }
}

I faced the same error. I've both Nginx and Apache installed. Nginx works as a reverse proxy and serves static files. Due to this reason, you have to insert the following code inside server directive:

If you use Nginx as reverse proxy for static files you have to put the code listed above inside a location. i.e:

    location ~ ^.+\.(jpg|jpeg|gif|png|webp|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js|JPG|JPEG|GIF|PNG|ICO|CSS|ZIP|TGZ|GZ|RAR|BZ2|DOC|XLS|EXE|PDF|PPT|TXT|TAR|WAV|BMP|RTF|JS) {
if (!-e $request_filename) {
                rewrite /wp-admin$ $scheme://$host$uri/ permanent; 
                rewrite ^(/[^/]+)?(/wp-.*) $2 last; 
                rewrite ^(/[^/]+)?(/.*\.php) $2 last;
        }

If you run nginx + php-fpm (no Apache and further url rewriting with mod_rewrite involved) you have to put the code inside server directive

1
source | link

I faced the same error. I've both Nginx and Apache installed. Nginx works as a reverse proxy and serves static files. Due to this reason, you have to insert the following directives inside server directive:

if (!-e $request_filename) {
        rewrite /wp-admin$ $scheme://$host$uri/ permanent;  
        rewrite ^(/[^/]+)?(/wp-.*) $2 last;                     
        rewrite ^(/[^/]+)?(/.*\.php) $2 last;                   
    }

The final .conf files shoul be similar to this (change your path accordingly):

server {
        ##DM - uncomment following line for domain mapping  
        #listen 80 default_server;
    server_name example.com *.example.com ;
    ##DM - uncomment following line for domain mapping
    #server_name_in_redirect off;

    access_log   /var/log/nginx/example.com.access.log;
    error_log    /var/log/nginx/example.com.error.log;

    root /var/www/example.com/htdocs;
    index index.php;

    if (!-e $request_filename) {
        rewrite /wp-admin$ $scheme://$host$uri/ permanent;  
        rewrite ^(/[^/]+)?(/wp-.*) $2 last;                     
        rewrite ^(/[^/]+)?(/.*\.php) $2 last;                   
    }

    location / {
        try_files $uri $uri/ /index.php?$args ;
    }

    location ~ \.php$ {
        try_files $uri =404;
        include fastcgi_params;
        fastcgi_pass 127.0.0.1:9000;
    }

    location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
        access_log off; log_not_found off; expires max;
    }

    location = /robots.txt { access_log off; log_not_found off; }
    location ~ /\. { deny  all; access_log off; log_not_found off; }
}

Hope this helps.