How to make Prevent Direct Access work on Bitnami

By default, Bitnami disable .htaccess files for security and performance reasons. They move the configuration in these .htaccess to the main application configuration files instead. In case of WordPress, it’s the htaccess.conf file under /opt/bitnami/apps/wordpress/conf/ folder.

So here are 3 simple steps that what you can do to make our Prevent Direct Access Premium version work on Bitnami:

  1. Under your WordPress admin, go to Settings > Permalinks, copy the mod_rewrite rules at the bottom of the page which looks something like this
  2. Locate and open htaccess.conf file (create one if necessary)
  3. Paste those codes on step 1 into that file
    <Directory /opt/bitnami/apps/wordpress/htdocs/>
    /* put your mod_rewrite rules here */
    </Directory>
  4. Restart Apache

Here you go! Our “Prevent Direct Access” plugin should be working well on your website now.