Bitnami WordPress - Prevent direct file access based on user selected (but still show unrestricted media on the frontend)

Job ID: 34118954

Budget: $10 – $30 USD

Hello!

I have this code working perfectly locally on Nginx but when moving to Bitnami and using htaccess it breaks.

MUST BE A BITNAMI install, that's what we will be deploying.

Details:
- media shows on the frontend
- directly accessing the media URL will check if the file has any restrictions, if so, only users assigned to the file (this is done through ACF, a user select field was added to all attachments)

The Redirect itself checks that function and the file type: (htaccess / access.php included)

That currently breaks ALL the images on the Bitnami install and subpages when its active.

If you can just fix the redirect above by looking at it, that would be great, if not I'll need to get you the actual code base.
Related categories: PHP WordPress Apache