Custom error path on .htaccess works in root but not in a folder found in root! HELP

Discussion in 'Apache' started by chiggers, Mar 10, 2008.

  1. #1
    Hi all reasonably new to the apache world here

    I want to have personalized error messages by using my .htaccess and the "errordocument" function.

    So my .htaccess is

    ErrorDocument 401 /error/authreqd.html
    AuthName "Blah Blah"
    AuthType Basic
    AuthUserFile /blah/password/.htpasswd
    Require valid-user

    And I get the error

    "Additionally, a 401 Authorization Required error was encountered while trying to use "

    Coincidentally the login is fine, I am just not getting the custom 401 page but when my .htaccess is as follows (401 custom pages in root folder rather than in error folder in root folder) it works as expected.


    ErrorDocument 401 /authreqd.html
    AuthName "Blah Blah"
    AuthType Basic
    AuthUserFile /blah/password/.htpasswd
    Require valid-user


    So this is something to do with my <directory> settings in my httpd.conf file right? (See settings below)

    <Directory />
    AllowOverride All
    Order Deny,Allow
    Deny from all
    </Directory>

    #
    # Note that from this point forward you must specifically allow
    # particular features to be enabled - so if something's not working as
    # you might expect, make sure that you have specifically enabled it
    # below.
    #

    #
    # This should be changed to whatever you set DocumentRoot to.
    #
    <Directory "D:\L_G_Version_3.0\Site">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important. Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Allow from all

    </Directory>

    I have had a little play (for three hours now! And searched the top search engines etc and looked through all my books!!!!) But cannot get it to work and cant really understand what is going on with the directory apart from the fact I am allowing the .htaccess to overide the httpd.conf <directory>

    Please help as I'd really like to know why its not working and how I control it (i also like things to be tidy on my server and wish all my custom errors to be in there own folder and not sat in the root directory)

    Many Thanks in Advance.
     
    chiggers, Mar 10, 2008 IP