Need help understanding .htaccess

design

#1

Hi everyone,

I’m having some major issues understanding and getting .htaccess to work. It appears that the .htaccess option in the DreamHost “Goodies” menu will do exactly what I want, the problem is, I can’t get it to work.

I want to create a “Member’s Area” on my webpage. I have all the files currently uploaded to one directory on my FTP server. Currently everything on the site works perfectly fine and as I expect it to. But, as soon as I create the new directory for the files I want to password protect, the main part of my page works fine but when I click on the link in the .htaccess section of the DreamHost panel, I get a 404 Not Found error. That’s happened every time I’ve tried using this method.

Could someone please help me? I’m a total newbie to building websites and I’m doing this for a group I work for to help us get exposure and help the students we teach. Could someone possibly help me with a step-by-step how to? Thank you in advance for any help that is offered.


#2

If you have a website called say http://example.com and your files that you want to be in your ‘Members Area’ are say at http://example.com/members then when you go to the Dreamhost htaccess/webdav page on the control panel you would first select your website e.g. http://example.com

Then on the next page you would add your members file folder name to the end of your website (http://example.com) so that it now reads http://example.com/members

Tick the box which says 'Password protect this dir?

In the ‘Directory “name”:’ box type a name for your area such as Members Area or My Groups Files.

In the ‘User accounts for this area:’ box you would overtype the already added ‘user password’ entry with a user name and a password. The user name does not have to be any of your already created user names but could be something like ‘members’ or ‘year2012’. The password is as you’d expect a good mix of letters and numbers and characters like % etc.

At this point you can select the ‘Forbid linking to files in this dir?
’ if you wish which is to stop people with websites elsewhere linking to your images and media files unless you wish them to. In which case you could add their website to the box shown.

Click the ‘change these settings’ button and after a few minutes the .htaccess file will appear in your http://example.com/members folder and this folder will then be protected requiring the ‘user password’ combination to be entered.

Note that any folders beneath http://example.com/members will also be protected by the same user/password. So http://example.com/members/test/area will be protected as well.

If you have protected http://example.com with a user/password then the whole site will be protected by that user/password.

You can Google .htaccess to get some useful information but be careful what you do as you can lock yourself out of your website. Although you would just need to delete the problem .htaccess file via ftp or ssh.