• Hi people,

    I set up an internal knowledge database with WordPress. Every post is only visible if you have a user account. Files like pdfs or solidworks 3D models are still accessible without password. How can I protect those, too?

    Of course, the easiest way would be to add a few lines to the .htaccess and make the whole wordpress directory password-protected, but I don’t want to annoy my editors with additional login credentials. So.. is it possible to protect file downloads with the wordpress login credentials?

    Thanks guys,
    Long

Viewing 2 replies - 1 through 2 (of 2 total)
  • File security outside of the realm of WP can be done at server level. Please review/consult.

    MickeyRoush

    (@mickeyroush)

    With .htaccess you can make sure that they are logged in. Something like this should work:

    RewriteCond %{HTTP_COOKIE} !wordpress_logged_in
    RewriteRule \.(pdf|solidworks)$ https://example.com/not-allowed/ [R=302,L]

    Where:

    \.(pdf|solidworks)$

    Are the file extensions you want to protect.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Password protect file downloads’ is closed to new replies.