Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How do i create a password protection for my whole iis website, which uses php for most of its sites? I put a web.config in the root folder, but that seemed to do nothing. What i want is a way to protect my entire site so that the only way to see any web page is to login similar to using .htaccess for apache. Except i probably want it to be able to use windows login. Here was the web.config i used.

 <configuration>
    <system.web>
       <authentication mode="Windows" />
    </system.web>
</configuration>
share|improve this question

2 Answers 2

up vote 1 down vote accepted

You have to install windows/basic authentication and then disable anonymous authentication in IIS administration console.

share|improve this answer
    
It took a little while to figure out what you meant, but i eventually got it to work. Thanks. –  user57776 Oct 22 '10 at 0:31

I don't know how to do equivalence of htaccess using a htpasswd or alike, but you can create windows accounts and right click your webroot, then in security tab limit access to a specific user (or groups of users).

share|improve this answer
    
What i meant by the htaccess thing was just that i wanted it to popup asking for a password, instead of me having to use php to code it. And i was trying what you said, but i accidentally denied ComputerName\Users which apparently includes the Administrator as well. Oops. Gotta find a way to reset that. –  user57776 Oct 21 '10 at 6:37
    
I fixed the permission accident, but it is still giving me a 500 error instead of asking for a user name and password. Is there a way i can get it to ask? I want it to be accessible to anywhere on the outside, but only people who are authenticated can view the site. –  user57776 Oct 21 '10 at 6:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.