ErrorDocument 401 sets 302 redirect in apache

Discussion in 'Apache' started by umeshnmenon, Nov 13, 2009.

  1. #1
    Hi All,

    I have an application where the first hit will go to file where we have authentcation enabled and if user enters valid credentials he/she will be redirected to a page (say Page A) and if user enters invalid credentails she/will be redirected to a different page (Page B). I am achiveing this using ErrorDocument directive in .htaccess file for 401. This 401 redirection works fine, but the issue apache is setting a 302 redirect to this page B once the user got a 401, and even on subsequent tries it is not asking the challenge rather doing a 302 redirect to Page B. How do I clear this 302 redirect. My objective is when we hit the url again then the user should be given a challenge to enter username/pwd. I tried giving headers to clear the cache but no help.

    Any help would be appreciated.

    Thanks in advance
     
    umeshnmenon, Nov 13, 2009 IP