• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

Stop Logged Out Users Downloading & Sharing Member Only Files

This solution enables you to restrict access to file downloads to logged in users only.

The .htaccess directives enable you to:

  1. Specify which file types can be downloaded.
  2. Block specific file types from being accessed and downloaded.
  3. Prevent sharing of direct links to member only downloads.
  4. Determine which URL users are redirected to when trying to download files while logged out.

Simply add this .htaccess file in the root directory you want to protect or add the directives on lines 4, 5 & 6 to your existing .htaccess file.

The above directives prevent zip files from being downloaded by logged out users (wordpress_logged_in) providing download access for logged in members only.

The directives also redirect logged out users to a specific page which in this case is the members-downloads page which contains a login form and link for membership sign up when the user is logged out. When logged in, the page contains members only downloads.

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems