Skip to main content
Ken Nielsen
Legend
November 2, 2016
Answered

How Can I protect a member's area folder on my site?

  • November 2, 2016
  • 4 replies
  • 638 views

I have a site working now, and with a member's area in a folder, all structured and linked together in Dreamweaver. I'm happy with it and if functions beautifully, but now the question... The member's area in the folder needs to be protected so just members have access. As it is, no one knows the address of the folder area, but once they do have access they need to keep the location URL to get back in. This means it is not protected from being shared with anyone, which I do not want.
I could change the name of the folder periodically, to discourage theft, but that is not a real solution. Do you have suggestions on how to approach this problem on a simple level?. I need to make access simple for people who have permission and hidden from people who don't.

    This topic has been closed for replies.
    Correct answer BenPleysier

    If it is just the one folder and you want easy security, then have a look at https://www.addedbytes.com/blog/code/password-protect-a-directory-with-htaccess/

    4 replies

    Ken Nielsen
    Legend
    November 2, 2016

    As is often the case, You are all right and you all deserve 'Correct Answer' but since only one 'Correct Answer' is allowed as the choice, I will take the first response but want you all to know, each answer hear is insightful and is monumental in helping me. Since I am not proficient with 'interactive' code, even though I've read David Powers great book on PHP, I am left with a fog in my mind on the subject. Like all learning, I think I need to try the simple approach first, and learn from that. Later, necessity will become the mother of invention to either learn to streamline my site, or hire someone to take on the task and have it done right. I will fiddle with the simple approach first, then report back here with my findings

    My sincere thanks to each of you for responding here, with much appreciation,

    Ken

    Rob Hecker2
    Legend
    November 2, 2016

    Nancy's suggestion is a nicer interface to achieving the same thing as Ben's suggestion. They are essentially the same suggestion in that they use the Apache webserver htpasswd function to create access users to a folder.

    You asked for a simple solution and that is what you have been offered. If the solution solves your problem, then you are lucky. But note the following:

    • This solution requires you, the developer, to manage the password access individually, so it is not a good solution if there are many different folders to protect or individual member passwords to manage
    • This solution is visually crude. If you need the solution to visually match the appearance of the website, this is not it.
    • This solution is not very secure. Just google "how to hack htpasswd"
    • Your users can't manage their own passwords, have them emailed to them when they forget them, etc. These are things users expect to be able to do.

    If it turns out that you do need more than the simple method offered here, then the solution becomes less simple.

    Nancy OShea
    Community Expert
    Community Expert
    November 2, 2016

    If your hosting plan gives you a c-Panel, log- in to your hosts panel and password protect your folder from there.  That's by far the simplest method.

    1. Log into your cPanel and click on the Password Protect Directories icon found under Security.
    2. Choose Web Root (you may also need to select Show Hidden Files)
    3. Click on the name of the directory that you wish to password protect.
    4. Check the box for Password protect this directory.

    Nancy O.

    Nancy O'Shea— Product User & Community Expert
    BenPleysier
    Community Expert
    BenPleysierCommunity ExpertCorrect answer
    Community Expert
    November 2, 2016

    If it is just the one folder and you want easy security, then have a look at https://www.addedbytes.com/blog/code/password-protect-a-directory-with-htaccess/

    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!