Nginx subdirectory wordpress wp-login redirects to 404 not foundNginx 404 not working with PHP?Nginx...

Is there a way to get a compiler for the original B programming language?

Reverse the word in a string with the same order in javascript

Do I have an "anti-research" personality?

Lock in SQL Server and Oracle

How to stop co-workers from teasing me because I know Russian?

Has any spacecraft ever had the ability to directly communicate with civilian air traffic control?

Why does nature favour the Laplacian?

Was there a Viking Exchange as well as a Columbian one?

Why was Germany not as successful as other Europeans in establishing overseas colonies?

Mysql fixing root password

gnu parallel how to use with ffmpeg

Can solid acids and bases have pH values? If not, how are they classified as acids or bases?

Corner spot where three faces meet

Do generators produce a fixed load?

What is the strongest case that can be made in favour of the UK regaining some control over fishing policy after Brexit?

When India mathematicians did know Euclid's Elements?

What is the point of Germany's 299 "party seats" in the Bundestag?

Please, smoke with good manners

Can fracking help reduce CO2?

Does jamais mean always or never in this context?

A ​Note ​on ​N!

Can someone publish a story that happened to you?

How to set the font color of quantity objects (Version 11.3 vs version 12)?

Nginx subdirectory wordpress wp-login redirects to 404 not found



Nginx subdirectory wordpress wp-login redirects to 404 not found


Nginx 404 not working with PHP?Nginx proxy_pass 404 error, don't understand whySeparate 404 page for subdirectoryWordpress, Apache and Nginx: permalinks and cacheWebmin: Cannot login through nginx reverse proxyNumber of execution and strange POST callsWordPress creating URLs which are not foundNginx server - Wordpress - .htaccessAdding “expires” directive in Nginx conf for assets causes “404 not found” errorsnginx - check if try_files succeeded or not






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







3















server {
location / {
try_files $uri $uri/ @extensionless-php;
}
location /shop {
try_files $uri $uri/ /shop/index.php?q=$uri&$args /shop/index.php?q=$uri&$args;
}
location ~ .php$ {
if ($request_uri ~ (.*).php$)
{
return 301 $1;
}
try_files $uri =404;
include /etc/nginx/fastcgi.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;

}
location @extensionless-php {
rewrite ^(.*)$ $1.php last;
}


The above code is used in nginx server file. I have wordpress installed in a subdirectory. When I try to login into my dashboad using username and password through wp-login.php page it redirects to 404 not found. The other pages of the wordpress blog works fine. I cannot access my dashboard only. Please help me to solve the issue. Thanks in advance.










share|improve this question





























    3















    server {
    location / {
    try_files $uri $uri/ @extensionless-php;
    }
    location /shop {
    try_files $uri $uri/ /shop/index.php?q=$uri&$args /shop/index.php?q=$uri&$args;
    }
    location ~ .php$ {
    if ($request_uri ~ (.*).php$)
    {
    return 301 $1;
    }
    try_files $uri =404;
    include /etc/nginx/fastcgi.conf;
    fastcgi_pass unix:/run/php/php7.0-fpm.sock;

    }
    location @extensionless-php {
    rewrite ^(.*)$ $1.php last;
    }


    The above code is used in nginx server file. I have wordpress installed in a subdirectory. When I try to login into my dashboad using username and password through wp-login.php page it redirects to 404 not found. The other pages of the wordpress blog works fine. I cannot access my dashboard only. Please help me to solve the issue. Thanks in advance.










    share|improve this question

























      3












      3








      3








      server {
      location / {
      try_files $uri $uri/ @extensionless-php;
      }
      location /shop {
      try_files $uri $uri/ /shop/index.php?q=$uri&$args /shop/index.php?q=$uri&$args;
      }
      location ~ .php$ {
      if ($request_uri ~ (.*).php$)
      {
      return 301 $1;
      }
      try_files $uri =404;
      include /etc/nginx/fastcgi.conf;
      fastcgi_pass unix:/run/php/php7.0-fpm.sock;

      }
      location @extensionless-php {
      rewrite ^(.*)$ $1.php last;
      }


      The above code is used in nginx server file. I have wordpress installed in a subdirectory. When I try to login into my dashboad using username and password through wp-login.php page it redirects to 404 not found. The other pages of the wordpress blog works fine. I cannot access my dashboard only. Please help me to solve the issue. Thanks in advance.










      share|improve this question














      server {
      location / {
      try_files $uri $uri/ @extensionless-php;
      }
      location /shop {
      try_files $uri $uri/ /shop/index.php?q=$uri&$args /shop/index.php?q=$uri&$args;
      }
      location ~ .php$ {
      if ($request_uri ~ (.*).php$)
      {
      return 301 $1;
      }
      try_files $uri =404;
      include /etc/nginx/fastcgi.conf;
      fastcgi_pass unix:/run/php/php7.0-fpm.sock;

      }
      location @extensionless-php {
      rewrite ^(.*)$ $1.php last;
      }


      The above code is used in nginx server file. I have wordpress installed in a subdirectory. When I try to login into my dashboad using username and password through wp-login.php page it redirects to 404 not found. The other pages of the wordpress blog works fine. I cannot access my dashboard only. Please help me to solve the issue. Thanks in advance.







      htaccess wordpress webserver nginx






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 3 hours ago









      PalPal

      361




      361






















          1 Answer
          1






          active

          oldest

          votes


















          1














          You may want to add a separate (nested) location ~ .php$ block for WordPress to isolate it from the extension-less PHP rules used for the rest of your site.



          For example:



          location / { ... }

          location ^~ /shop {
          try_files $uri $uri/ /shop/index.php?q=$uri&$args;
          location ~ .php$ {
          try_files $uri =404;
          include /etc/nginx/fastcgi.conf;
          fastcgi_pass unix:/run/php/php7.0-fpm.sock;
          }
          }

          location ~ .php$ { ... }

          location @extensionless-php { ... }


          The ^~ modifier gives the prefix location higher precedence than the regular expression locations at the same level. See this document for details.






          share|improve this answer
























          • Thanks for the quick reply. It resolved my issue. Now all are working fine.

            – Pal
            2 hours ago











          • @Pal If this answered your question then please consider marking it as "accepted" (checkmark on the left below the voting arrows) to give credit and help other users. You can also "upvote" answers you find useful. Thanks, much appreciated. :)

            – MrWhite
            52 mins ago












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "45"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fwebmasters.stackexchange.com%2fquestions%2f122528%2fnginx-subdirectory-wordpress-wp-login-redirects-to-404-not-found%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          You may want to add a separate (nested) location ~ .php$ block for WordPress to isolate it from the extension-less PHP rules used for the rest of your site.



          For example:



          location / { ... }

          location ^~ /shop {
          try_files $uri $uri/ /shop/index.php?q=$uri&$args;
          location ~ .php$ {
          try_files $uri =404;
          include /etc/nginx/fastcgi.conf;
          fastcgi_pass unix:/run/php/php7.0-fpm.sock;
          }
          }

          location ~ .php$ { ... }

          location @extensionless-php { ... }


          The ^~ modifier gives the prefix location higher precedence than the regular expression locations at the same level. See this document for details.






          share|improve this answer
























          • Thanks for the quick reply. It resolved my issue. Now all are working fine.

            – Pal
            2 hours ago











          • @Pal If this answered your question then please consider marking it as "accepted" (checkmark on the left below the voting arrows) to give credit and help other users. You can also "upvote" answers you find useful. Thanks, much appreciated. :)

            – MrWhite
            52 mins ago
















          1














          You may want to add a separate (nested) location ~ .php$ block for WordPress to isolate it from the extension-less PHP rules used for the rest of your site.



          For example:



          location / { ... }

          location ^~ /shop {
          try_files $uri $uri/ /shop/index.php?q=$uri&$args;
          location ~ .php$ {
          try_files $uri =404;
          include /etc/nginx/fastcgi.conf;
          fastcgi_pass unix:/run/php/php7.0-fpm.sock;
          }
          }

          location ~ .php$ { ... }

          location @extensionless-php { ... }


          The ^~ modifier gives the prefix location higher precedence than the regular expression locations at the same level. See this document for details.






          share|improve this answer
























          • Thanks for the quick reply. It resolved my issue. Now all are working fine.

            – Pal
            2 hours ago











          • @Pal If this answered your question then please consider marking it as "accepted" (checkmark on the left below the voting arrows) to give credit and help other users. You can also "upvote" answers you find useful. Thanks, much appreciated. :)

            – MrWhite
            52 mins ago














          1












          1








          1







          You may want to add a separate (nested) location ~ .php$ block for WordPress to isolate it from the extension-less PHP rules used for the rest of your site.



          For example:



          location / { ... }

          location ^~ /shop {
          try_files $uri $uri/ /shop/index.php?q=$uri&$args;
          location ~ .php$ {
          try_files $uri =404;
          include /etc/nginx/fastcgi.conf;
          fastcgi_pass unix:/run/php/php7.0-fpm.sock;
          }
          }

          location ~ .php$ { ... }

          location @extensionless-php { ... }


          The ^~ modifier gives the prefix location higher precedence than the regular expression locations at the same level. See this document for details.






          share|improve this answer













          You may want to add a separate (nested) location ~ .php$ block for WordPress to isolate it from the extension-less PHP rules used for the rest of your site.



          For example:



          location / { ... }

          location ^~ /shop {
          try_files $uri $uri/ /shop/index.php?q=$uri&$args;
          location ~ .php$ {
          try_files $uri =404;
          include /etc/nginx/fastcgi.conf;
          fastcgi_pass unix:/run/php/php7.0-fpm.sock;
          }
          }

          location ~ .php$ { ... }

          location @extensionless-php { ... }


          The ^~ modifier gives the prefix location higher precedence than the regular expression locations at the same level. See this document for details.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 3 hours ago









          Richard SmithRichard Smith

          442137




          442137













          • Thanks for the quick reply. It resolved my issue. Now all are working fine.

            – Pal
            2 hours ago











          • @Pal If this answered your question then please consider marking it as "accepted" (checkmark on the left below the voting arrows) to give credit and help other users. You can also "upvote" answers you find useful. Thanks, much appreciated. :)

            – MrWhite
            52 mins ago



















          • Thanks for the quick reply. It resolved my issue. Now all are working fine.

            – Pal
            2 hours ago











          • @Pal If this answered your question then please consider marking it as "accepted" (checkmark on the left below the voting arrows) to give credit and help other users. You can also "upvote" answers you find useful. Thanks, much appreciated. :)

            – MrWhite
            52 mins ago

















          Thanks for the quick reply. It resolved my issue. Now all are working fine.

          – Pal
          2 hours ago





          Thanks for the quick reply. It resolved my issue. Now all are working fine.

          – Pal
          2 hours ago













          @Pal If this answered your question then please consider marking it as "accepted" (checkmark on the left below the voting arrows) to give credit and help other users. You can also "upvote" answers you find useful. Thanks, much appreciated. :)

          – MrWhite
          52 mins ago





          @Pal If this answered your question then please consider marking it as "accepted" (checkmark on the left below the voting arrows) to give credit and help other users. You can also "upvote" answers you find useful. Thanks, much appreciated. :)

          – MrWhite
          52 mins ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Webmasters Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fwebmasters.stackexchange.com%2fquestions%2f122528%2fnginx-subdirectory-wordpress-wp-login-redirects-to-404-not-found%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

          How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

          夢乃愛華...