• Resolved tri3shnyirl5a3f

    (@tri3shnyirl5a3f)


    As soon as I installed and activated WooCommerce in the production environment, I got a 501 error. I can’t even change the order attribution settings.
    It works without any issues in the test environment on a subdomain on the same server, and on localhost.
    The .htaccess file contents in the WordPress root directory of the production and test environments are the same except for the BASIC authentication scope setting.
    I don’t understand why the behavior differs between the production and test environments. However, the plugin configuration is slightly different. I have installed Wordfence and other plugins in the production environment.

    The server is a Shin rental server (https://www.shin-server.jp/) from the X Server series, and the control panel is almost identical to X Server’s.
    I have read several online articles suggesting that disabling the WAF command in the server control panel is effective, but I have not done so because I have security concerns and it is not a fundamental solution.
    The WooCommerce version is 10.4.0.
    Please let me know if you have any solutions. Thank you in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Sai (woo-hc)

    (@saivutukuru)

    Hi @tri3shnyirl5a3f ,

    A 501 error usually means the server is blocking or rejecting a request that WooCommerce needs to run. Since it works in your test environment and on localhost, this is most likely related to a server-level rule, the WAF, or another plugin such as Wordfence on the production site.

    To help narrow this down, please check the following:

    1. Are any security features blocking admin-ajax or REST API requests? WooCommerce depends on the REST API. If possible, check the server or Wordfence logs for blocked requests.
    2. Can you temporarily deactivate security plugins like Wordfence and any other firewall plugin, then try activating WooCommerce again? This is only for testing.
    3. Can you run a basic conflict test? Switch to a default theme (Storefront or Twenty Twenty-X) and deactivate all plugins except WooCommerce, then check if the error appears.
    4. Are there any ModSecurity or WAF logs from your hosting panel? Many hosts block WooCommerce REST API calls unintentionally. You don’t need to disable the WAF completely; your host can usually whitelist only the specific rule that is being triggered.
    5. Please share your PHP version and any server error logs generated at the moment the 501 occurs. 

    These steps will help identify where the block is happening. Once you have this information, we can guide you further.

    Thread Starter tri3shnyirl5a3f

    (@tri3shnyirl5a3f)

    • Are any security features blocking admin-ajax or REST API requests? WooCommerce depends on the REST API. If possible, check the server or Wordfence logs for blocked requests.

    Probably not. I tried it before 3:00 AM, but I can’t find any Wordfence logs.

    • Can you temporarily deactivate security plugins like Wordfence and any other firewall plugins, then try activating WooCommerce again? This is only for testing.

    I would love to do this, but since this will be in a production environment, I have no choice but to do it late at night. My working days are limited.

    • Can you run a basic conflict test? Switch to a default theme (Storefront or Twenty Twenty-X) and deactivate all plugins except WooCommerce, then check if the error appears.

    I would love to do this, but since this will be in a production environment, I have no choice but to do it late at night. My working days are limited.

    • Are there any ModSecurity or WAF logs from your hosting panel? Many hosts unintentionally block WooCommerce REST API calls. You don’t need to disable the WAF completely; your host can usually whitelist only the specific rule that is being triggered.

    Unfortunately, there aren’t.

    • Please share your PHP version and any server error logs generated at the moment the 501 error occurs.

    Production: PHP Version: 8.3.21 64-bit OS
    Test Environment: PHP Version: 8.3.21 64-bit OS

    I’m hesitant to attach the error log here for security reasons.
    Can I send it to you directly?

    Hi @tri3shnyirl5a3f,

    I understand your concerns, especially around making changes or running tests on a production site during the day, and it is great that you are planning to do those checks later at night when traffic is lower. You can also consider creating a staging copy of your site for these tests, as this keeps your live environment unaffected. If you eventually decide to test directly on your production site, it is always best to take a full backup before doing so for peace of mind.

    About sharing the error log or system status report, there is no direct way to send those privately through this forum since everything here is public. You can use https://pastebin.com or https://quickforget.com or https://gist.github.com to share the information securely, then drop the link here so I can review it with you.

    Whenever you are ready, feel free to share the details and I will gladly take another look. Let’s see how it goes!

    Plugin Support Feten L. a11n

    (@fetenlakhal)

    Hi there,

    As we haven’t received a response in some time, I’ll mark this ticket as resolved. Please don’t hesitate to reach out if you need further assistance.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.