
You might have updated your WooCommerce plugin to the latest version and you encountered the file not found go to shop error. This error means that the file cannot be reached because of lack of Apache mod_xsendfile module. Below are two solutions to the problem.
Solution 1 (enable Redirect Only)
This is a temporary solution to enable clients download their products as you work on a permanent solution.

- Go to WooCommerce Menu
- Click settings
- Then click Products
- Under Products, go to Downloadable products
- Then under File download method select Redirect Only
- Then click the save changes button
- Test whether the products can now be downloaded
WARNING: Solution 1 approach is not recommended by WooCommerce because after making a purchase, the buyer can see the URL of the file being downloaded for example (https://blogiestools.com/file.pdf), and share it anywhere (including social media). The file URL can also be accessed by any user without necessarily having to log in.
NOTE: If you must use solution 1, it is advisable to stop people from linking to your website files by preventing hotlinking. Add the code below your .htaccess file to prevent hotlinking.
## BEGIN PREVENT HOTLINKING ##
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)example.com/.*$ [NC]
RewriteRule \.(zip|rar|mp3|docx|doc|pdf)$ - [F]
## END PREVENT HOTLINKING ##
You can remove or add any file extension that you want to disable hotlinking in the last line. In the example above, we have prevented linking to zip, rar, mp3, docx, doc, and pdf file extensions.
Solution 2 (enable mod_xsendfile Apache module)
This solution requires someone with root access. You will be required to install mod_xsendfile Apache module.
- Install the package by running the following command via SSH.
yum install ea4-experimental
yum install ea-apache24-mod_xsendfile
- end or exit command
- Restart apache server
- Go to easyApache modules and enable mod-xsendfile and click next upto the last next button and then click provision. Once provision process is complete

- Go to WooCommerce>settings>products>downloadable products and select X-Accel-Redirect/X-Sendfile
- Add the code below to htaccess if X-Accel-Redirect/X-Sendfile does not work after running the command above
<IfModule mod_xsendfile.c>
<Files *.php>
XSendFile On
SetEnv MOD_X_SENDFILE_ENABLED 1
</Files>
</IfModule>
If you are on shared hosting and you are not able to install mod_xsendfile then contact your host.
Solution 3 (remove spaces from download url)
If you have few products, you can manually re-upload the file to be downloaded without any spaces and then regenerate download permission so that users who had purchased it can be able to download in future.
After uploading the download file without any spaces in the url, go to WooCommerce settings and set the file download method to whichever you want. It should work.
Before you leave, Subscribe to our Newsletter to be updated via email when Blogging Tools you use to run your blog release new features or make critical changes. For any question about this post, or anything else related to website technologies, we are responding on Reddit or comment below.
AGF says
Option #2 above does not work; I tried it through my hosting support exactly as stated.
This may be a bigger core woocommerce problem. There is now a github opened for this issue [https://github.com/woocommerce/woocommerce/issues/30288] as well as a multi-user woocommerce support ticket [https://wordpress.org/support/topic/file-not-found-error-for-downloadable-product-orders/]
If you have any other ideas, I’d love to hear/try them…
AGF says
Actually, Option #2 above does work, but:
1) you may need to define the XSendFilePath in the vhost configuration;
2) the downloads must be served from the woo media folders, not from another subdomain or outside source.
At least, that’s what made it work for us using the X-Accel-Redirect/X-Sendfile option…
AlbaWeb says
My hosting company won’t install mod_xsendfile as they say it is deprecated.
This is really bad that we have a forced update that breaks our sites.
I have solution 1 working for now but really not good enough
MP says
I tried solution 3 – I replaced a downloadable file with no spaces, made a test purchase but the file did not download and I received the same error message.
When I look at files that do have spaces in the file name, a hyphen is automatically added in place of the space in the filepath that is automatically generated for the product, so really there aren’t any spaces in the download link anyway.
Either way – didn’t work, unless I have done something incorrectly.
Editorial Staff says
For Solution 3 to work, you are supposed to name your file without any space between words. Any file that you upload with a space, then the space will be replaced with a hyphen in the url, and there lies the problem. Have you tried adding one word to the file? For instance: example.com/wp-content/uploads/woocommerce_uploads/2021/07/mytestfile.pdf
Greg Smith says
I used hyphens to separate the words in my filename and it came up with an “File Not Found”. When I removed the hyphens, I was able to download the file perfectly. Don’t use hyphens or spaces.