<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body>
Pete Nesbitt wrote:
<blockquote cite="mid200402241916.33549.pete@linux1.ca" type="cite">
  <pre wrap="">On February 24, 2004 09:10 am, Srinivas Koppisetti wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi All,

We want to display custom error pages based on the user directory. This
page will only disply when they dont have access to see that page.
Obviously we are using htaccess directory access file. I was wondering how
we can do it in apache? Also I want to develop an interface that validates
a user to this htaccess encripted password.

How do we approach these issues?

Thanks in Adv for you help.

Srinivas'
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Hi,
Have a look at the apache site (httpd.apache.org). There is a directive you 
can add to each directory stanza (or global) that defines what error page to 
display.  Check their docs, but I think it is something like:
ErrorDocument 404 /path_to/file

You may also want to use the config file directory stanzas to do your access 
control instead of leaving the htaccess file in the document area.

If by "develop an interface" you mean the pop-up login box, sorry, I can't 
help.
  </pre>
</blockquote>
If you want different errors in different directories, then put an
.htaccess in the directory and link it to the error page as above:<br>
<br>
ErrorDocument XXX /path_to/file<br>
<br>
For XXX use the correct error number.  404 is a PAGE NOT FOUND.  You
wanted a 401 AUTHORIZATION REQUIRED.<br>
<br>
Mostly only the 400s are used.  You can check your logs to see if any
particular errors show up more than others or several times.<br>
<br>
<br>
<table cellspacing="2" cellpadding="2" border="0">
  <tbody>
    <tr>
      <td colspan="2" align="center"><b>Client Request Errors</b></td>
    </tr>
    <tr>
      <td bgcolor="#cccccc">400</td>
      <td bgcolor="#cccccc"> Bad Request</td>
    </tr>
    <tr>
      <td bgcolor="#cccccc">401</td>
      <td bgcolor="#cccccc"> Authorization Required</td>
    </tr>
    <tr>
      <td bgcolor="#cccccc">402</td>
      <td bgcolor="#cccccc"> Payment Required (not used yet)</td>
    </tr>
    <tr>
      <td bgcolor="#cccccc">403</td>
      <td bgcolor="#cccccc"> Forbidden</td>
    </tr>
    <tr>
      <td bgcolor="#cccccc">404</td>
      <td bgcolor="#cccccc"> Not Found</td>
    </tr>
    <tr>
      <td bgcolor="#cccccc">405</td>
      <td bgcolor="#cccccc"> Method Not Allowed</td>
    </tr>
    <tr>
      <td bgcolor="#cccccc">406</td>
      <td bgcolor="#cccccc"> Not Acceptable (encoding)</td>
    </tr>
    <tr>
      <td bgcolor="#cccccc">407</td>
      <td bgcolor="#cccccc"> Proxy Authentication Required</td>
      <td><br>
      </td>
    </tr>
    <tr>
      <td bgcolor="#cccccc">408</td>
      <td bgcolor="#cccccc"> Request Timed Out</td>
    </tr>
    <tr>
      <td bgcolor="#cccccc">409</td>
      <td bgcolor="#cccccc"> Conflicting Request</td>
    </tr>
    <tr>
      <td bgcolor="#cccccc">410</td>
      <td bgcolor="#cccccc"> Gone</td>
    </tr>
    <tr>
      <td bgcolor="#cccccc">411</td>
      <td bgcolor="#cccccc"> Content Length Required</td>
    </tr>
    <tr>
      <td bgcolor="#cccccc">412</td>
      <td bgcolor="#cccccc"> Precondition Failed</td>
    </tr>
    <tr>
      <td bgcolor="#cccccc">413</td>
      <td bgcolor="#cccccc"> Request Entity Too Long</td>
    </tr>
    <tr>
      <td bgcolor="#cccccc">414</td>
      <td bgcolor="#cccccc"> Request URI Too Long</td>
    </tr>
    <tr>
      <td bgcolor="#cccccc">415</td>
      <td bgcolor="#cccccc"> Unsupported Media Type</td>
    </tr>
  </tbody>
</table>
<br>
<br>
<br>
</body>
</html>