odd behaviour on basic auth password protected page
Results 1 to 4 of 4

Thread: odd behaviour on basic auth password protected page

  1. #1
    Un Re Member cretaceous's Avatar
    Join Date
    Sep 2004
    Location
    London UK
    Posts
    940

    odd behaviour on basic auth password protected page

    I don't use htaccess 'basic auth' often.
    In fact it will usually only be to lock off a site while in development.

    So I added it on a domain and the log in dialog box appears fine and logs me in ok..
    But if I sit there and click the 'cancel' box on the log in as fast as I can, then the log in goes away and I can see my page in its entirety.
    No style or images but the text is there.

    I'm thinking this is because the .htaccess has the mod_rewrite lines in there, so they are being called prior to the basic auth part.
    I tried moving the auth stuff higher up but made no difference and then in IE I couldn't even cancel to see the empty "you do not have permission etc. " screen

    The rewrite lines end [QSA,NE,NC,L] so I'm guessing the culprit is the 'L' - but I need that in there.


    Code:
    RewriteEngine on
    RewriteBase /
    Options +FollowSymlinks
    
    RewriteRule ^([A-Za-z0-9\?=&_-]+)/([A-Za-z0-9\?=&_-]+)$ index.php?sc=$1&pg=$2 [QSA,NE,NC,L]
    RewriteRule ^([A-Za-z0-9\?=&_-]+)$ index.php?pg=$1 [QSA,NC,L]
    
    AuthType Basic
    AuthName "preview"
    AuthUserFile "/home/xyz/.htpasswds/public_html/passwd"
    require valid-user
    It's not mega important here, but I'd rather it didn't do this - any ideas?

  2. #2
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,715
    No *good* ideas, unfortunately. Do you have access to httpd.conf?
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  3. #3
    Un Re Member cretaceous's Avatar
    Join Date
    Sep 2004
    Location
    London UK
    Posts
    940
    Yes I should do - it's a VPS.. how not-good is your idea then?!

  4. #4
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,715
    Well, it's untested, unproven and only a guess ... can you setup your basic auth in that file instead and see if anything changes?
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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