myriad360
09-22-2006, 02:26 AM
Alright, so I am having problems with this... not working. Ex.:
ErrorDocument 401 X:/rejection.html
AuthUserFile C:/auth/.htpass
AuthGroupFile /dev/null
AuthName "Development Members"
AuthType Basic
require valid-user
I can still access the folders in which my .htaccess is in, like it is not effecting it. I have looked at the tutorials mentioned on Coding Forums, and I only see or hear about Unix paths, nothing about how to do Windows paths. The only experience I have with paths is in the http.conf file, and that format I don't think is working here. Help!
_Aerospace_Eng_
09-22-2006, 08:10 AM
What type of server are you running? I thought htaccess only worked on apache servers.
myriad360
09-22-2006, 06:43 PM
I am runnning Apache, but on Windows. I am having a really hard time finding examples with Windows-like paths, like 'C:\web' etc. Only with ones like '/web/home' etc. So I am not really sure what my problem is, but I am almost sure I have to fix my paths.
Does anyone run Apache on Windows? It doesn't seem so when it comes to htaccess. But I am really anxious to tackle this problem, and I will surely document my results for anyone like myself.
schleppel
09-23-2006, 12:13 AM
Your ErrorDocument path should be relative to your doucment root (but starting with a /) eg. domain.com/dir/rejection.html would be /dir/rejection.html, not a physical server path.
You don't need the AuthGroupFile line.
The following path to the password file worked fine for me: C:/server/.htpasswd
Try:
ErrorDocument 401 /rejection.html
AuthUserFile C:/auth/.htpass
AuthName "Development Members"
AuthType Basic
Require valid-user
myriad360
09-25-2006, 03:06 PM
Nope, that didn't work. Sounds like I may have a different problem; do I need to do anything to the http.conf or anything else?
schleppel
09-25-2006, 05:35 PM
Between the <Directory> tags for your document root (or for the subdirectory if there's one for it), set AllowOverride to All if it isn't already.
myriad360
09-27-2006, 05:03 AM
That worked, much thanks! For anyone else who is looking to figure this out, it is in this are:
#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
Options Indexes FollowSymLinks MultiViews
#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
and not this area:
#
# Each directory to which Apache has access, can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# permissions.
#
<Directory />
Options FollowSymLinks
AllowOverride None
</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.