WordPress.org

Ready to get started?Download WordPress

Forums

Easy Digital Downloads
[resolved] All Download Links Get 404 Errors After Updates today (73 posts)

  1. giganut
    Member
    Posted 1 year ago #

    Yes I am a program developer, and I sell my program on my site, if thats what you mean.

  2. No, I was asking if you have a development/staging version of your site (a second instance of your site) that can be used for safely testing?

    I have only been able to replicate this issue in one instance, and that was only when running on a server using nginx, not apache.

  3. giganut
    Member
    Posted 1 year ago #

    I backed everything up and updated the plug in, so far everything seems to be working fine, I will report back in the morning and let you know if everything is still working or not.

    Thanks,

  4. Great!

  5. giganut
    Member
    Posted 1 year ago #

    My site started to do it again.

  6. IT's not possible for EDD to just start doing something like this. Something has to have changed.

    Any plugin updates? Server updates? Theme updates?

  7. giganut
    Member
    Posted 1 year ago #

    The only change was me upgrading EDD plug in again, Remember I had reverted back to the previous version.

  8. Yes but yesterday you said you upgraded and it worked perfectly fine, so what happened between now and then?

  9. giganut
    Member
    Posted 1 year ago #

    Nothing at all no updates, what should the .htaccess look like, is this right? I remember it was something different before.

    Options -Indexes
    deny from all
    <FilesMatch '\.(jpg|png|gif)$'>
    Order Allow,Deny
    Allow from all
    </FilesMatch>
  10. giganut
    Member
    Posted 1 year ago #

    Ok I just go it working again, this is what I did, I edited the .htaccess like this.

    Original before the edit was made

    Options -Indexes
    deny from all
    <FilesMatch '\.(jpg|png|gif)$'>
    Order Allow,Deny
    Allow from all
    </FilesMatch>

    This is what I changed it to and now it's working again

    Options -Indexes
  11. giganut
    Member
    Posted 1 year ago #

    Ok something really strange is happening here, when I change the .htaccess to this

    Options -Indexes

    And then upload a new file the .htaccess file changes back to this

    Options -Indexes
    deny from all
    <FilesMatch '\.(jpg|png|gif)$'>
    Order Allow,Deny
    Allow from all
    </FilesMatch>

    And then the download links give a 404 error again.

  12. That's because EDD does that intentionally to ensure the file does not get accidentally deleted. To fix it, do this instead:

    function pw_edd_htaccess_rules( $rules ) {
    	return 'Options -Indexes';
    }
    add_filter( 'edd_protected_directory_htaccess_rules', 'pw_edd_htaccess_rules' );

    Place that in your theme's functions.php or a custom plugin.

  13. giganut
    Member
    Posted 1 year ago #

    Will this work?

    <?php
    
    // Exit if accessed directly
    if ( !defined('ABSPATH')) exit;
    
    /**
     *
     * WARNING: Please do not edit this file in any way
     *
     * load the theme function files
     */
    require ( get_template_directory() . '/includes/functions.php' );
    require ( get_template_directory() . '/includes/theme-options.php' );
    require ( get_template_directory() . '/includes/post-custom-meta.php' );
    require ( get_template_directory() . '/includes/tha-theme-hooks.php' );
    require ( get_template_directory() . '/includes/hooks.php' );
    require ( get_template_directory() . '/includes/version.php' );
    
    function pw_edd_htaccess_rules( $rules ) {
    	return 'Options -Indexes';
    }
    add_filter( 'edd_protected_directory_htaccess_rules', 'pw_edd_htaccess_rules' );
  14. Yep!

  15. giganut
    Member
    Posted 1 year ago #

    My site sent me to a 404 forbidden .htaccess warning after putting the code in the file, so I had to remove it. please can you point me in the right direction to find a good tutorial to make a custom plugin. or how much to have you do it for me?

  16. giganut
    Member
    Posted 1 year ago #

    is this included in the change log of the new update?

  17. Use Pluginception: http://wordpress.org/plugins/pluginception/

    Yes, the htaccess rule changes were included in the changelog.

  18. hevenz
    Member
    Posted 1 year ago #

    sighs

    man everytime a new release is made stuff breaks, now i am getting 404 errors, its set to forced and i have my files outside of webroot

  19. giganut
    Member
    Posted 1 year ago #

    So far so good I made the custom plugin and it's working fine as of now. I will let you know if I have any other problems, thanks Pippin for the support.

  20. @hevenz please read over the posts in this thread and se if that solves the issue.

  21. hevenz
    Member
    Posted 1 year ago #

    already read through them all :)

  22. And did that solve them for you?

  23. hevenz
    Member
    Posted 1 year ago #

    nope :)

    did you change something where files cannot be outside webroot?

  24. There were a few changes made, but not specific to paths.

    As a quick test, does it work if your files are not in the webroot?

  25. hevenz
    Member
    Posted 1 year ago #

    i'll try that later and let you know

  26. If that doesn't work, I've also just found a bug that could be causing this: https://github.com/easydigitaldownloads/Easy-Digital-Downloads/commit/4818a3a1b7d5a15fe8b92497761243fc3b3125f5

  27. Austin Passy
    Member
    Posted 1 year ago #

    I am still getting 404's on all downloads. Updated the current 1.6.2 and reverted to 1.5.2.2 and getting 404. But this only happened after I first upgraded to 1.6.

    Really not sure what to do.

  28. Austin Passy
    Member
    Posted 1 year ago #

    Not sure why the .htaccess file has all that additional code if that's what breaks it. From looking at the comments before removing everything but Options -Indexes seems to fix the issue. So why the new code?

  29. The new code prevents direct linking to files, and on every server I've beeb able to test it on, the extra rules work just fine, so really not sure why they're breaking for both of you.

    Austin, have you applied the same fix I gave above?

  30. Austin Passy
    Member
    Posted 1 year ago #

    Yes, after I re-upload the .htacess file with the old Options -Indexes only and add the filter downloads started working again.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.