WordPress.org

Support

Support » Plugins and Hacks » Easy Digital Downloads » [Resolved] All Download Links Get 404 Errors After Updates today

[Resolved] All Download Links Get 404 Errors After Updates today

Viewing 15 replies - 31 through 45 (of 72 total)
  • Plugin Author Pippin Williamson

    @mordauk

    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.

    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,

    Plugin Author Pippin Williamson

    @mordauk

    Great!

    My site started to do it again.

    Plugin Author Pippin Williamson

    @mordauk

    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?

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

    Plugin Author Pippin Williamson

    @mordauk

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

    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>

    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

    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.

    Plugin Author Pippin Williamson

    @mordauk

    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.

    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' );
    Plugin Author Pippin Williamson

    @mordauk

    Yep!

    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?

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

Viewing 15 replies - 31 through 45 (of 72 total)
  • The topic ‘[Resolved] All Download Links Get 404 Errors After Updates today’ is closed to new replies.
Skip to toolbar