Results 1 to 2 of 2

Thread: Help with .htaccess?

  1. #1
    Junior Member Gina's Avatar
    Join Date
    Mar 2004
    Posts
    1

    Question 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!

  2. #2
    Senior Member
    Join Date
    Sep 2005
    Location
    Russia, Nizhny Novgorod
    Posts
    315

    Default

    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •