How to make Prevent Direct Access work on WP Engine

By default, our plugin (both Free and Gold version) doesn’t work on websites hosted on WP Engine who utilizes both Apache and Nginx web server.

However, with these simple tweaks now you can use Prevent Direct Access (PDA) Gold on WP Engine.

PDA Gold Redirect Rules

  1. Log in to your WP Engine User Portal
  2. Under your website “Installs”, click on “Redirect rules” then “New redirect rule”

  3. Enter these codes into the popup fields as per our attached screenshot
    Domain: Choose your website domain
    You will need to create 2 redirect rules as described below.

    For version 3.0 and above

    Redirect name: Rules for original links
    Source: wp-content/uploads(/_pda/.*\.\w+)$
    Redirect type* 301 Permanent

    Redirect name: Rules for private links
    Source: private/([a-zA-Z0-9-_]+)$
    Redirect type* 301 Permanent

    * Please follow your WordPress Site Address (URL) – with or without www

    Rules for original links
    Redirect Rules for Prevent Direct Access original links
    Redirect Rules for Prevent Direct Access private links

    For version 2.x.x

    Redirect name: Rules for original links:
    Source: wp-content/uploads/(.+)(\.)([A-Za-z0-9]+)$
    Destination: index.php?pre_dir_acc_61co625547=$1&is_direct_access=true&file_type=$3
    Redirect type* 301 Permanent

    Redirect name: Rules for private link:
    Source: private/([a-zA-Z0-9-_]+)(/auth-[a-zA-Z0-9-_]+){0,1}$
    Destination: index.php?pre_dir_acc_61co625547=$1&custom_181191=$2
    Redirect type* 301 Permanent

Folder Protection Redirect Rules

Please implement these redirect rules for our Folder Protection feature to work properly on WP Engine hosting. You will need our Access Restriction plugin for this to work properly.

Please note that:

  • If you change Prefix for Private URL (on our Settings page), you need to replace the word private accordingly
  • As WP Engine doesn’t support RewriteRule Flags, all your private and original links will appear “raw” anyway. However, if you implement these WP Engine redirect rules, you can use (and access) pretty as opposed to raw URLs. For example,
    • Raw (Ugly) URL:
    • Pretty URL:
  • As always, please make sure you’re using the latest version of our plugin.

Feel free to contact us for support if you face any problems or have any questions.

Lasted updated on September 9, 2019