[Web4lib] .htaccess help?

Thomas Dowling tdowling at ohiolink.edu
Fri Mar 30 12:10:34 EDT 2007


On 3/30/2007 11:28 AM, Junior Tidal wrote:

> Hi all, 
> 
> I want to password protect a directory that uses index.php as the main
> index file. I've updated the .htaccess to include 
> 
> DirectoryIndex index.php
> 
> but I keep getting a 404 error whenever I try to access the directory.
> There is no pop-up for a username or password, and index.php contains no
> errors. What the file does is connect to an external MySQL database and
> displays the info into a webpage. Can anyone help me figure out what is
> going wrong?
> 


[You are using Apache, right?]

I think you have three separate issues here: setting up the directory
index (which looks Ol Korrect here), setting up basic authentication for
the password protection, and figuring your your 404 Not Found error.

For the 404 problem, you may need to look at the server logs to see what
the server is actually looking for (and not finding) when you ask for
your directory.

For the basic auth stuff, you first need to set up the password file
with htpasswd, and then there's a handful of directives to go in you
.htaccess file.  <http://httpd.apache.org/docs/2.2/howto/auth.html> is a
reasonably good tutorial.


-- 
Thomas Dowling
tdowling at ohiolink.edu


More information about the Web4lib mailing list