Wordpress plugin requires .htaccess to work: How to enable

:warning: IMPORTANT, please fill the questions

We assume you are using Bitnami to deploy your application.

  • Which version of the application are you using?: Bitnami Wordpress 4.7.4 running on Ubuntu 14.04.5 and Linux 3.13.0

  • Please choose how you got the application: Installer (Windows, Linux, macOS), cloud image (AWS, GCE, Azure, …) or VM (VMDK, VBOX): Cloud Image AWS

  • Have you installed any plugin or modified any configuration file?: Added Plugin Wishlist Member

  • Describe here your question/suggestion/issue (expected and actual results): How can I enable folder/file protection using an .htaccess file? WishList Member, a wordpress membership plugin, creates a protected folder for member access at: /opt/bitnami/apps/wordpress/htdocs/files. Each membership level has a folder under files. For a membership level named client, the path to protected member content would be /opt/bitnami/apps/wordpress/htdocs/files/client.

  • Steps to reproduce the issue (if relevant):

  • Copy the apache log (if relevant):

PASTE HERE

Hi @deanpro007

In Bitnami we have all the different .htaccess files inside the /opt/bitnami/apps/wordpress/conf/htaccess.conf. This makes the webserver process faster the requests.

If you need to add any .htaccess file you can add the content of it to the htaccess.conf file and it will be processed by the webserver.
Would this work for you?

Best regards,
David Barranco.

1 Like

David,

Thanks for the response. I added the .htaccess file to htaccess.conf. Folder protection still doesn’t work.

George

Hi,

try using the codes in the file httpd-prefix.conf.

:wink:

Pedro.

Hi @deanpro007,

Did you restart the Apache service after modifying the htaccess.conf file?

sudo /opt/bitnami/ctlscript.sh restart apache

Please note that you’ll need to use a Directory directive in Apache when modifying the htaccess.conf file. This is only one example:

I hope that helps.
Jota

BITNAMI COMMUNITY

Thanks to all for your assistance.

I’ve tried the actions that have been recommended. The folder protection still doesn’t work.

I’m using the Wishlist Member membership plug-in. Page and post protection is working. Folder protection isn’t working.

I created a folder named “files” using the plug-in. It then adds a sub-folder under “files” for each membership level. My site has one membership level: “client”. The plug-in adds an .htaccess file for the “client” folder. All files under should be protected, only accessible by members who are authenticated at log-in.

The content of .htaccess is:

<Directory "/opt/bitnami/apps/wordpress/htdocs/files/client”>
# BEGIN WishList Member Folder Protection
Options FollowSymLinks
RewriteEngine on
#RewriteCond %{REQUEST_URI}  ^client/*
RewriteRule ^(.*)$ /index.php?wlmfolder=client&restoffolder=$1 [L]
# END WishList Member Folder Protection
</Directory>

I added the following Directory directive and above code to the htaccess.conf:

<Directory "/opt/bitnami/apps/wordpress/htdocs/files/client”>
# BEGIN WishList Member Folder Protection
Options FollowSymLinks
RewriteEngine on
#RewriteCond %{REQUEST_URI}  ^client/*
RewriteRule ^(.*)$ /index.php?wlmfolder=client&restoffolder=$1 [L]
# END WishList Member Folder Protection
</Directory>

I also left the .htaccess in the “client” folder.

I then restarted Apache.

The address of the test document I’m protecting is:

http://www.consultant-in-a-box.com/files/client/plain_english_handbook.pdf.

When I enter the address through … /client/, the browser (safari) displays -403 Forbidden in the address bar. However, after adding the protected PDF file name, the Forbidden message disappears and I’m able to view the PDF — when logged out of the site as a non-member.

I’ve also been working with Wishlist Member support. To provide you with additional context, I attached their last response regarding my issue.

Please confirm I followed the process you recommended. I would appreciate any other suggestions, etc.

Thanks,

George
image

Hi,

If you want to enable the .htaccess files (which seems to be a requirement of the plugin), then do the change the following in /opt/bitnami/apps/wordpress/conf/httpd-app.conf:

From:

        AllowOverride None

To:

        AllowOverride All

Then restart Apache:

sudo /opt/bitnami/ctlscript.sh restart apache

Hope it helps.

Best regards,

Javier J. Salmerón


Was my answer helpful? Click on :heart:

4 Likes

Javier and All,

Thanks for your help! The “AllowOverride to All” fixed the folder protection issue. I appreciate everyone’s responses/suggestions.

Thanks,

George

Hi,

Thanks for letting us know. We will mark this thread as Solved. Please open a new ticket in case you find more issues.

Best regards,

Javier J. Salmerón


Was my answer helpful? Click on :heart: