Gossamer Forum
Home : General : Perl Programming :

can i have if..else in the httpd.conf file

Quote Reply
can i have if..else in the httpd.conf file
Hi,
I am a newbie to apache(on win-nt).Our company have a website which can be viewed both by guests and by our employees.I have used <directory> directive to block access to a particular folder in our company web site.So whenever the guest tries to access some files present in the resricted folder, an authentication screen would pop up asking for username and password and when correct credentials are supplied the user is given access to the
restricted folder.Now the problem is there is a login page which will be used for our employees to login to the site.So when one of our employee has successfully logged in and now tries to view the files in the restricted folder,he is again shown the authentication screen .So is there a mechanism whereby we can prevent a previously authenticated person from getting authenticated again...Can we have a if ..else construct in the httpd file and
set some variable during the first quthentication process and check for the variable during the <directory> directive validation...


Pls help..It is of utmost urgency...


Thanx,
Alfred

Quote Reply
Re: can i have if..else in the httpd.conf file In reply to
Use .htaccess within your restricted folder...don't put the login functions within your ROOT .htaccess or .config files.

Regards,

Eliot Lee
Quote Reply
Re: can i have if..else in the httpd.conf file In reply to
Eliot I almost fell into the trap of saying that too but he mentions that he is using Win-NT

Installations:http://www.wiredon.net/gt/
Favicon:http://www.wiredon.net/favicon/

Quote Reply
Re: can i have if..else in the httpd.conf file In reply to
.htaccess files work perfectly with Apache on any OS - including Windows * (although you may need to enable it in the configuration with "Allow Override")

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: can i have if..else in the httpd.conf file In reply to
Yep you are right - I don't even know why I said that because I've used Apache on my local pc with .htaccess - duh!

Installations:http://www.wiredon.net/gt/
Favicon:http://www.wiredon.net/favicon/

Quote Reply
Re: can i have if..else in the httpd.conf file In reply to
> but he mentions that he is using Win-NT

What's your point?

Last edited by:

Wil: Jul 8, 2005, 3:25 AM
Quote Reply
Re: can i have if..else in the httpd.conf file In reply to
As I just explained...I was mistaken.

Not thinking straight as usual
Barking up the wrong tree
Missed the point
Whoosh....

For some reason I thought that Win NT couldn't use .htaccess even though infact I knew it could...

Slip of the tongue...or fingers in this case....


Installations:http://www.wiredon.net/gt/
Favicon:http://www.wiredon.net/favicon/

Quote Reply
Re: can i have if..else in the httpd.conf file In reply to
Paul

Ah right. You made me scratch my balding head there for a minute!

Last edited by:

Wil: Jul 8, 2005, 3:26 AM