Forum Moderators: phranque

Message Too Old, No Replies

Internal redirect to basic authentication using htaccess files

         

thing3b

11:01 pm on Mar 7, 2006 (gmt 0)

10+ Year Member



I am trying to get use only htaccess files to internally redirect a site to a folder that has basic authentication.

My basic authentication is set up using an htaccess file in the folder that I am redirecting to. Shown below is the htaccess file that I currently have tested and works. You need to enter a password if you are not comming from localhost.

Order Allow,Deny
AuthType Basic
AuthName "System Administration"
AuthUserFile XXXXXXXXXXXXXXXXXXXX
Require valid-user
Allow from 127.0.0.1
Satisfy Any

I then have a plain old htaccess file to redirect the entire site to the directory containing the basic authentication. The basic authentication works fine, and the redirection works fine, but when the 2 are used together I get 404 errors.

Any help would be great,
Thanks.

thing3b

2:06 am on Mar 8, 2006 (gmt 0)

10+ Year Member



Hum... Ok...
I am sure that the line in the htaccess file was:
ErrorDocument 404 /error
instead of:
ErrorDocument 401 /error

Thanks everyone how helped... yeah right