• Resolved cmsplay

    (@cmsplay)


    Flummoxed!

    I’ve a WP-WooCommerce site which is a sub-domain of another site. The file structure is:

    mainsite.com
    >public_html_folder
    >>subsite.com
    >>>wp-content_folder

    I’m planning on making digital music files available. These I understand have to live in a folder OUTSIDE of the public_html folder.

    I have tried making a folder for downloads called e.g. <music_files_folder>, and placing it thus:

    mainsite.com
    >music_files_folder
    >>music_file.mp3
    >public_html_folder
    >>subsite.com
    >>>wp-content_folder

    The thing is, when I copy the URL of the music file using an FTP client, and paste it into:

    WooCommerce>Products>Product data>Variations>Downloadable files>File URL

    …I get a message saying either that the file does not exist, or a 404 page displays.

    I’m not sure if I should be using the mainsite.com part of the URL or not, or whether I should be using:

    ./

    …to move up one folder. Maybe WooCommerce can’t go where customers can’t go.

    Can anybody tell me kind of URL I should be using here, or perhaps WooCommerce can’t cope with folders above public_html ?

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    These I understand have to live in a folder OUTSIDE of the public_html folder

    Would you mind sharing a bit more on where you got that advice? The reason I’m asking is that, by default, WooCommerce expects the download path for digital products to be contained in the wp-content/uploads directory of where WordPress is installed.

    Thread Starter cmsplay

    (@cmsplay)

    Hi Riaan,

    The advice comes from here:

    (Wind to ca 1’04 onward.)

    Essentially, even if WP encodes the URL, then when the customer downloads they can trace the URL that the WP-coded product URL leads to, and access folder content from there.

    I think that the problem is that (perhaps understandably) my hosting is not permitting any public access outside of the <public_html> folder.

    jessepearson

    (@jessepearson)

    Automattic Happiness Engineer

    @cmsplay If you are using either the Force Downloads or X-Accel-Redirect/X-Sendfile described in the below document, you shouldn’t need to change the folder where the files are:
    https://docs.woocommerce.com/document/digital-downloadable-product-handling/

    If permissions are set up correctly on the server, as outlined in the doc, then no one should have direct access to the folders to download other items.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Download Links Not Working’ is closed to new replies.