[ad_1]
[ad_2]
I have tried Prevent Direct Access plugin it didn't work; whenever i visit a url like this: {LINK}/wp-content/uploads/2024/09/{FILE}.docx
it still opens the file. I just want to show 403 or redirect.

If you’re linking directly to the file, WordPress isn’t part of the equation.
To expound on my previous comment, you would need something between the user and the file – a script which checks whether the user has permission to access the file, or not. By the looks of it, this is what the Prevent Direct Access plugin does – “Once a WordPress file is protected, Prevent Direct Access will automatically generate a private download link containing a random string for you to access or share this private file with others.”
You would need to use the private download links that the Prevent Direct Access plugin generates, using the wp-content/uploads link is no good.