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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    New Coder
    Join Date
    Jul 2007
    Posts
    54
    Thanks
    17
    Thanked 0 Times in 0 Posts

    My htaccess won't let me in

    Hey all,

    I am trying to lock down a subfolder in my website,

    Using the .htaccess tutorial, I managed to get it working, but now, when I enter my username/password, I keep getting the user/pass popup all the time, it does not let me through. If I hit cancel, then it goes 401.

    What am I doing wrong or what am I missing?


    Thanks,

    Heeter

  • #2
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    move to general web building and post ur htaccess code.

  • #3
    New Coder
    Join Date
    Jul 2007
    Posts
    54
    Thanks
    17
    Thanked 0 Times in 0 Posts
    Thanks Rafiki

    I don't think that I can move this thread, sorry for posting in wrong forum section.

    Here is my .htaccess

    Code:
    AuthName "Test Database" 
    AuthType Basic 
    AuthUserFile C:/Apache2.2/.htpasswd 
    AuthGroupFile /dev/null
    require valid user

    Thanks Again,

    Heeter

  • #4
    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
    Not sure what tutorial you followed but this one seemed to work for me http://www.javascriptkit.com/howto/htaccess3.shtml

    And its also provided on javascriptkit.com which is a sister site of codingforums.com so its resources are reliable.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New Coder
    Join Date
    Jul 2007
    Posts
    54
    Thanks
    17
    Thanked 0 Times in 0 Posts
    Thats the one I used,

    Thanks Aerospace Eng.

    I am not saying that the tut is wrong, I know that I am either missing something, or something is in the wrong place. Just can't quite put my finger on it.

    Heeter

  • #6
    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
    Does your webhost not have the option to setup password protected directories? Most hosts do. You should look into it.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #7
    New Coder
    Join Date
    Jul 2007
    Posts
    54
    Thanks
    17
    Thanked 0 Times in 0 Posts
    Thanks for the response,

    I actually am my own host, here are my specs:

    Windows2003Standard
    Apache 2.2
    PHP5
    MySQL5

    Domain: hcctech.ca
    Subfolder trying to lock: hcctech.ca/testdb
    using "user" for user and "test" for password

    This is for testing purposes, once I figure this out, I will setup something more permanent.




    Heeter
    Last edited by Heeter; 07-30-2007 at 06:21 AM.

  • #8
    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
    The last line should be
    Code:
    require valid-user
    not
    Code:
    require valid user
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #9
    New Coder
    Join Date
    Jul 2007
    Posts
    54
    Thanks
    17
    Thanked 0 Times in 0 Posts
    Thanks, Aerospace.

    changed it like you mentioned, but still doing the same thing.

    I restarted Apache just to be sure, as well.

    Authentication keeps poping up, no matter what I enter, but hit cancel and it goes 401

    Code:
    AuthName "Test Database"
    AuthType Basic 
    AuthUserFile C:/Apache2.2/.htpasswd 
    AuthGroupFile /dev/null
    require valid-user

    Thanks,


    Heeter
    Last edited by Heeter; 07-30-2007 at 06:49 AM.

  • #10
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,927
    Thanks
    6
    Thanked 1,040 Times in 1,013 Posts
    I suppose it has something to do with the path (in AuthUserFile). Have you checked the directory structure? Is the htpasswd file directly located in C:/Apache2.2? Or is there more like C:/Apache2.2/htdocs or /wwwroot (I’m not so familiar with Apache on Windows).

  • #11
    New Coder
    Join Date
    Jul 2007
    Posts
    54
    Thanks
    17
    Thanked 0 Times in 0 Posts
    Thanks for the response VIPStephan

    the .htpasswd file is in C:/Apache2.2

    I have deleted that file and created new ones using the handy-dandy tool of the tut, to no avail. They have all been put there in that directory.

    I am now officially pulling my hair out on this one......

    Heeter
    Last edited by Heeter; 07-31-2007 at 12:24 AM.

  • #12
    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
    Put the following in a php file and post what you get
    PHP Code:
    <?php
    echo $_SERVER['DOCUMENT_ROOT'];
    ?>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #13
    New Coder
    Join Date
    Jul 2007
    Posts
    54
    Thanks
    17
    Thanked 0 Times in 0 Posts
    I get this:

    Code:
    E:/
    My E drive is my webserver files.

    Thanks,


    Heeter

  • #14
    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
    That seems to be the issue. I don't think you can use another drive as the location of your htpasswd file. I'm guessing if you put it in the E:/ drive and then changed this
    Code:
    AuthUserFile C:/Apache2.2/.htpasswd
    to this
    Code:
    AuthUserFile E:/.htpasswd
    It will likely work.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #15
    New Coder
    Join Date
    Jul 2007
    Posts
    54
    Thanks
    17
    Thanked 0 Times in 0 Posts
    Hi,

    I made the mods to the htaccess, and moved the htpasswd to the new place, and it is still doing the same thing.


    Thanks so far for your help, Aerospace,


    Heeter


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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