• Hi,

    I understand that Woocommerce adds .htaccess file in the /woocommerce_uploads/ folder, and that .htaccess file has a single line in it that says deny from all

    Some sources for the above understanding:

    @frankbiganski Sorry for the confusion, there should be a .htaccess file in the /woocommerce_uploads/ folder itself, and that file should only have a single line in it that says deny from all.
    From <https://wordpress.org/support/topic/woocommerce_uploads-downloadable-path-bug/#post-11012521&gt;

    Protecting your uploads directory
    By default WooCommerce introduces a .htaccess file to protect your wp-content/uploads/woocommerce_uploads directory, however, this doesn’t guarantee the protection of this directory, since everything depends on the configuration of the server.
    From <https://docs.woocommerce.com/document/digital-downloadable-product-handling/#protecting-your-uploads-directory&gt;

    Now whenever I update Woocommerce, I see errors being logged as:
    [access_compat:error] [pid 15492:tid 1056] [client 127.0.0.1:61698] AH01797: client denied by server configuration: [path]/wp-content/uploads/woocommerce_uploads/, referer: [siteadress]/wp-content/uploads/woocommerce_uploads/

    It would be great if anyone can guide me on this.

    Thanks a lot!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter KoolPal

    (@koolpal)

    Hi All,

    Can anyone please guide on this? It seems to be a recurring problem with EVERY upgrade!

    Plugin Support Niall a11n

    (@wpniall)

    Hi @koolpal!

    The folder is blocked per the .htaccess rule, which should block access to all folders and files in /woocommerce_uploads/. The logs show that requests to the uploads folder were blocked as expected.

    The AH01797 error: client denied by server configuration in the log you shared suggest a hosting issue. I suggest contacting your web host to confirm that, as this appears to be a server configuration or permissions issue.

    Thread Starter KoolPal

    (@koolpal)

    @wpniall Thank you for replying.

    1. Why is this folder being accessed during an update to Woocommerce plugin? As I see this error ONLY when I update Woocommerce plugin (as and when updates are released)

    2.

    The logs show that requests to the uploads folder were blocked as expected.

    Since you mention that requests were blocked as expected then I do not understand the need to contact my hosting provider.

    Please let me know if there is any understanding issue from my end. If not, please help me with answers to the above questions.

    Thanks

    Plugin Support Niall a11n

    (@wpniall)

    You’re welcome @koolpal

    I think you understood everything correctly. I’m happy to answer your questions to provide further clarification:

    1. Why is this folder being accessed during an update to Woocommerce plugin? As I see this error ONLY when I update Woocommerce plugin (as and when updates are released)

    The folder gets accessed during updates to verify and update the .htaccess file if needed. That’s why the error only appears when you update WooCommerce.

    Since you mention that requests were blocked as expected then I do not understand the need to contact my hosting provider.

    Yes, you’re correct here. If your site works correctly and you don’t have any issues with [Downloadable Products](https://docs.woocommerce.com/document/digital-downloadable-product-handling/), then there’s no need to contact your web host for further clarification. For instance, if you only see the error when updating WooCommerce and your site and downloads work correctly, then I’d ignore the error.

    If you do face any issues, then I’d recommend contacting your host’s support team. They should be able to help you fix the permissions issue so that there are no errors when updating WooCommerce.

    Please let me know if you need further clarification.

    Thread Starter KoolPal

    (@koolpal)

    @wpniall

    Thanks again for replying but I am not getting any conclusive answer as yet.

    The folder gets accessed during updates to verify and update the .htaccess file if needed. That’s why the error only appears when you update WooCommerce.

    What should be the correct code in .htaccess file to AVOID seeing this error?

    Else are you saying that everyone SHOULD BE seeing this [access_compat:error] whenever they update Woocommerce?

    Thanks

    Plugin Support Ena P (a11n)

    (@drwpcom)

    Hi @koolpal. This issue is not likely to be related to your .htaccess file.

    My first recommendation is to do some conflict testing on your site to see if you can figure out what is causing the problem. We have a guide to help with that here – https://docs.woocommerce.com/document/how-to-test-for-conflicts/.

    If that doesn’t help, please ask your hosting company if there are errors logged related to MySQL running out of resources. Hopefully that provides some information to come up with a solution.

    Thread Starter KoolPal

    (@koolpal)

    @drwpcom Thank you for your reply.

    While waiting for some actionable answers here, I created some test sites on my local machine with just WordPress + Storefront Theme + Woocommerce without any other plugins.

    I installed an older version of Woocommerce and then ran an update and encountered the SAME message as reported by me.

    I think we can rule out conflicts safely.

    What else do you suggest now?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘.htaccess – woocommerce_uploads folder’ is closed to new replies.