How to Properly Configure Password Protection using IIS Manager

I wrote this article because there seems to be some conflicting information on the Internet, but there is a simple way to password protect a directory in IIS with IIS Manager.

  1. First, connect to your site using IIS Manager.
  2. Next, highlight the root folder or the sub-folder you want to protect and then double click on the Authorization Rules module.

authorizationrules

3. Now, highlight the Allow All Users rule and click on the Remove link.

remove

4. Click on the Add Allow Rule… link which will bring up the window below.

add

5. Select the Specified users: option, enter a Windows/FTP username which has access to the site, and click on the OK button.

Now, when you enter the URL that points to the folder, you will be prompted to enter your Windows credentials to gain access.  If you prefer, you can create a web.config file with the following markup (or add it to an existing one) and place it the directory you want to protect.

< ?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system .webServer>
        <security>
            <authorization>
                <remove users="*" roles="" verbs=""></remove>
                <add accessType="Allow" users="WindowsUsername"></add>
            </authorization>
        </security>
    </system>
</configuration>

SQL Error involving Auto Close

This was a solution I discovered years ago when troubleshooting a customer’s database problem.  The error thrown was:

The log for database ‘database_name’ is not available. Check the event log for related error messages. Resolve any errors and restart the database.

It was caused by the Auto Close database property being set to true.  To rectify the issue, you will need to bring the database offline, bring it back online again, and then set the Auto Close property to false.

Error in URL Rewrite Rules for WordPress 4.6.1 Multi-site Configuration

Yesterday, one of our customers asked for help troubleshooting a 404 error he was getting every time he tried to access the dashboard (admin interface) of any sub-site he created and wondered if there was anything that needed to be changed server side to get it to work.   I informed him that if he followed the instructions on WordPress’ Official Site, it should work without additional intervention from us.  I was partially correct.  Since I’ve never configured a WordPress Multi-site before, I spent more than a couple of hours going through the steps myself and indeed ran into the same problem that our customer experienced.  I then scoured the web for a solution and knew it had something to do with the URL Rewrite rules but was unable to figure out a solution.  Fortunately, our customer was able to find the solution himself which I will now share with you.

On line 24 (WordPress Rule 4) of the web.config markup that WordPress gives you when you click on the Network Setup link under Settings, it reads:

<action type=”Rewrite” url=”{R:1}” />

It needs to be changed to:

<action type=”Rewrite” url=”{R:2}” />

Many thanks to Lucas Nieboer for pointing out the solution!