password protected folder can i bypass it for a ip

Discussion in 'Apache' started by techexpressinc, Nov 10, 2008.

  1. #1
    this is what i coded in the .htaccess file for my ip but it is not working any ideas for improvement??



    Options -Indexes
    AuthType Basic
    AuthName "restricted area"
    AuthUserFile /data/13/1/150/135/1313461/user/1406792/htdocs/employeesatisfy/.access.pwd
    AuthPam_Enabled off

    Require valid-user
    Order allow,deny
    Allow from 69.245.249.165
    Satisfy Any
     
    techexpressinc, Nov 10, 2008 IP
  2. evera

    evera Peon

    Messages:
    283
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    How about adding this code:

    RewriteEngine   On 
    RewriteRule %{REMOTE_ADDR}   !^69\.245\.249\.165 - [C]
    Code (markup):
     
    evera, Nov 10, 2008 IP
  3. techexpressinc

    techexpressinc Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    would i add those two lines below my "Satisfy any" ??

    Thanks for the help.
    Russ
     
    techexpressinc, Nov 11, 2008 IP
  4. techexpressinc

    techexpressinc Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I added the 2 lines to the bottom and got this

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.
     
    techexpressinc, Nov 11, 2008 IP
  5. techexpressinc

    techexpressinc Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    error log =

    [Tue Nov 11 18:49:27 2008][alert] [client 205.178.182.165] /data/13/1/150/135/1313461/user/1406792/htdocs/employeesatisfy/.htaccess: RewriteCond: bad flag delimiters
     
    techexpressinc, Nov 11, 2008 IP
  6. evera

    evera Peon

    Messages:
    283
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Sorry mixed something up. Now i understand what you want.
    I sorted out your code:
    
    Options -Indexes
    AuthName "restricted area"
    AuthType        Basic
    AuthUserFile /data/13/1/150/135/1313461/user/1406792/htdocs/employeesatisfy/.access.pwd
    Require         valid-user
    AuthPam_Enabled off
    
    order deny,allow
    allow from 69.245.249.165
    deny from all
    Satisfy Any
    
    Code (markup):
    You had it right, only the deny from all at the end was missing. I'm not sure if AuthPam_Enabled off is really needed...
    But Satisfy Any will bypass the passwordcheck from the ip 69.245.249.165
     
    evera, Nov 12, 2008 IP
  7. vovaNux

    vovaNux Peon

    Messages:
    47
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Please, tell me whether this solution is working as I need to do almost the same... All users need a password to log in, except from one IP address.
     
    vovaNux, Nov 12, 2008 IP