• Hello,

    We are using your plugin to lock down access to files in the WordPress Media Library to only logged in users. We are having issues with certain files giving a “Media Not Found” message when they exist in the correct uploads folder. I believe this may have to do with the .htaccess rules that are being put in place by your plugin. It happens often when they are replacing a file with a file of the same name. Have you seen this issue and what can I do to fix it?

    Thanks,
    Mike

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Support Nayeem Hyder

    (@nriddhi)

    Hello Mike,

    Hope you are well. Thanks for writing to us. It can have cache issue too or you can also save setting for the file again that it will regenerate settings again for that file. Please kindly check and let me know.

    Thank you and kind regards

    • This reply was modified 5 months, 2 weeks ago by Nayeem Hyder.
    Thread Starter onsharp

    (@onsharp)

    Nayeem,

    I have found the issue but I’m not sure what to do about it. It’s adding multiple lines to the .htaccess file that adds the protection to the file(s) in question. In this case there are multiple lines referencing the same file in the same folder but they all have different wpdmmediaids. The older ones are first in the list so once it hits that record it returns a file not found error and stops, not making it to the correct line in the .htaccess file. Does that make sense? So either removing duplicates or creating the htaccess file in the opposite direction, placing newer records above the older records instead of below would fix this issue.

    Thanks,
    Mike

    Plugin Support Nayeem Hyder

    (@nriddhi)

    I have checked your issue from localhost, it it is working properly in here, tried replacing from directory folder it renders the file properly, also replacing from media library appends -1 to the file name. Can you please kindly check and let me know?

    Thank you and kind regards

    Thread Starter onsharp

    (@onsharp)

    OK, I was able to recreate my issue using the following steps.

    1. Add a new file to the media library.
    2. Add protection to that file from the backend of the site using your plugin functionality.
    3. From the media library delete that same file permanently. (Do not remove the file protections)
    4. Add that same file to the media library again.
    5. Add protection to that file from the backend of the site using your plugin functionality.
    6. This causes two lines in the .htaccess file referencing the same file in the same folder with two different IDs. When you try to access the file it gets to the old record first and returns a media not found error.

    Example lines from the htaccess file.
    RewriteRule ^(2024/09/PDF-File-2.pdf)$ ../../index.php?wpdmmediaid=9493&wpdmmedia=$1
    RewriteRule ^(2024/09/PDF-File-2.pdf)$ ../../index.php?wpdmmediaid=9494&wpdmmedia=$1

    Thread Starter onsharp

    (@onsharp)

    I also tested it on a clean WordPress install with only your plugin installed and it did the same thing. Just wanted to eliminate any theme or plugin things.

    Plugin Support Nayeem Hyder

    (@nriddhi)

    Does the .htaccess file residing in wp-admin, wp-content, wp-includes same folder , please kindly check and let me know.

    Thank you and kind regards

    Thread Starter onsharp

    (@onsharp)

    I’m not sure exactly what you’re asking but this is in regards to the .htaccess file located in the uploads directory.

    Plugin Support Nayeem Hyder

    (@nriddhi)

    Sorry for the inconvenience. We are checking the issue, I have already forwarded it to our related team authority.

    Thank you and kind regards

    Thread Starter onsharp

    (@onsharp)

    Thanks! I appreciate the support.

    Thread Starter onsharp

    (@onsharp)

    To me, the easiest fix would be to build the htaccess file in the opposite order, if possible.

    Thread Starter onsharp

    (@onsharp)

    The client I’m having this issue with just complained again. Has any progress been made on this issue?

    Plugin Support Nayeem Hyder

    (@nriddhi)

    I have again forwarded it to our related team authority. Please kindly check and let me know if you have any queries.

    Thank you and kind regards

    Plugin Support Nayeem Hyder

    (@nriddhi)

    I have back with information from our team that, right now, there are two alternatives for your issue,

    1. Remove all restrictions from media library files
    2. delete all rules from .htaccess file

      Please kindly check and let me know.

      Thank you and kind regards
    Thread Starter onsharp

    (@onsharp)

    1. Remove all restrictions from media library files
      This is not an option. The client has hundreds of files restricted and they are restricted for a reason. They are running a site that has files only accessible to logged in users. This would make the files accessible to the public and therefore negate the use of your plugin entirely.
    2. delete all rules from .htaccess file
      This essentially does the same thing as #1 and then when the client restricts a file it will rebuild the entire .htaccess file from the database entry. So this is not really an option either.
    Plugin Support Nayeem Hyder

    (@nriddhi)

    I have forwarded your message to our team member. Please kindly check and let me know if you have any queries.

    Thank you and kind regards

Viewing 15 replies - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.