Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Mar 2006
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    htaccess on windows

    Alright, so I am having problems with this... not working. Ex.:
    Code:
    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!

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    What type of server are you running? I thought htaccess only worked on apache servers.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    Mar 2006
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Regular Coder
    Join Date
    Oct 2004
    Posts
    330
    Thanks
    0
    Thanked 13 Times in 13 Posts
    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:
    Code:
    ErrorDocument 401 /rejection.html
    
    AuthUserFile C:/auth/.htpass
    AuthName "Development Members"
    AuthType Basic
    Require valid-user

  • #5
    New Coder
    Join Date
    Mar 2006
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sorry for the delay...

    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?

  • #6
    Regular Coder
    Join Date
    Oct 2004
    Posts
    330
    Thanks
    0
    Thanked 13 Times in 13 Posts
    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.

  • #7
    New Coder
    Join Date
    Mar 2006
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Presto!

    That worked, much thanks! For anyone else who is looking to figure this out, it is in this are:
    Code:
    #
    # 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:

    Code:
    #
    # 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.


  •  

    Posting Permissions

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