Help with .htaccess?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gina
    Junior Member
    • Mar 2004
    • 1

    Help with .htaccess?

    Hi all, I'm trying to make my entire site password protected except for one file, login.html which is located in the public_html folder (along with a bunch of other subfolders and files). This file is also going to be the new "default" page for the site. It's a temporary measure right now, so I don't want to make changes to the directory structure and files.

    Can someone tell me how to do this with an .htaccess file....or if anyone has any other ideas on how to accomplish this, I'd surely listen. See below for the "long story".

    ~~~~~~
    Problem: My blog was accidentally outed to my husband's side of the family. I password protected the whole site, but readers were confronted with a user/pass box and no way to contact me. Many readers don't have my email address, and many of them never comment, so I had no way to notify them of what happened and give them a user/pass. So, I figured the best thing to do would be to make my front page be accessible, with an email link. However, "index,html" is the front page of my blog, and in order to change that, I have to completely rebuild the directory structure. *sigh*

    Goal: I have to (1)Have some way to let my readers contact me to get a user/pass when they try and access the site. I want to choose who gets access. (2)Have the rest of my site password protected without having to change the directory structure and files too much. (3)Have it easily reversible (4)Keep my head from blowing up. Well, that last one is optional.

    So basically, that's the deal. sorry if that is nonsense, but my head is spinning from trying to understand the Apache manual.
    ~~~~~~

    Can anyone help?
    Thanks!
  • ZYV
    Senior Member
    • Sep 2005
    • 315

    #2
    Not sure how .htaccess can help. If I were you I would assign different permissions to the different users groups of my blog. I think that can be done with the blog engine I use, Wordpress. Wordpress can also let you protect individual blog entries with a password.

    Apart from this, if you really want to use .htaccess to get basic auth on some pages I see no other way then make use of <Files></Files> section with some basic regular expressions. Say you have an index.html which you want to open for everybody. Then make an expression that will match everything except index.html. Basically you just need to make up a regular expression that will suit your needs and wrap your Auth commands with a <Files> block that uses this regexp.

    Not the easiest way for an Apache beginner, but I don't have enough time to make you a sample code.

    Comment

    Working...