When you manage a Microsoft Internet Information Services (IIS) web server, you'll occasionally need to take a site offline. Whether you're decommissioning an old project, responding to a security breach, or stopping an unauthorized application, knowing how to properly shut down unwanted websites keeps your server secure and organized.
Stopping a site in IIS isn't just about flipping a single switch; you have several distinct methods depending on whether you want to completely halt traffic, block specific malicious visitors, or remove the site entirely. Let's break down the exact steps to manage or shut down unwanted web traffic on your Windows server.
Understanding Your Options for Disabling a Website
Before you take action, you need to decide how permanent or broad the shutdown should be. Different situations call for different approaches:
- Temporary Maintenance: You want to stop traffic briefly without destroying site configurations.
- Complete Decommissioning: You're removing the site from the server permanently.
- Selective Access Blocking: You want the site running for administrators, but blocked for everyone else or specific IP addresses.
Method 1: Stopping the Website in IIS Manager
If your goal is an immediate halt to all incoming HTTP and HTTPS traffic for a specific site without deleting its files, you can stop the site directly from the IIS management console. If you want more about the background of this, Associated Press offers an excellent summary.
- Press the Windows key, type
inetmgr, and press Enter to open IIS Manager. - In the Connections pane on the left, expand your server name and click on Sites.
- Click on the specific website you want to shut down.
- Look at the Actions pane on the far right. Under Manage Website, click Stop.
When you stop a site this way, IIS immediately unbinds the ports for that site. Visitors attempting to access the URL will receive a connection refused or service unavailable error.
Method 2: Disabling the Associated Application Pool
Sometimes a website shares resources or runs multiple sub-applications. If stopping the site via the main switch doesn't cut off background worker processes, you can target the underlying application pool.
- Open IIS Manager and click on Application Pools in the left-hand Connections pane.
- Locate the application pool dedicated to the unwanted website.
- Right-click the application pool and select Stop.
Stopping the application pool stops the worker process (w3wp.exe) handling the site's code execution. This is especially useful if a specific application is consuming excessive server resources or behaving maliciously. For deeper documentation on managing Windows Server environments, check out the Microsoft Learn IIS Documentation.
Method 3: Blocking Specific Traffic or IP Addresses
If you don't want to shut down the entire website, but rather block unwanted traffic, bad actors, or specific scrapers from accessing it, you can utilize the built-in security features.
- Open IIS Manager and select the website you want to protect.
- In the Features View, double-click IP Address and Domain Restrictions. (If you don't see this, you must install the feature via Windows Server Manager under Web Server Security).
- In the Actions pane on the right, click Add Deny Entry...
- Enter the specific IP address or IP range you want to block, and click OK.
Users coming from those blocked addresses will immediately see a 403 – Forbidden: Access is denied error page.
Method 4: Taking ASP.NET Apps Offline with App_Offline.htm
For ASP.NET web applications, you don't always need to touch IIS Manager. You can gracefully take a site offline by dropping a simple file into its root directory.
- Navigate to the physical folder where your website files are stored on the server.
- Create a new HTML file named exactly
app_offline.htm. - Open the file in a text editor and write a brief message like "Site under maintenance."
- Save the file in the root directory.
IIS detects this file and automatically shuts down the application domain, serving the app_offline.htm page to all incoming requests while keeping the rest of the server untouched.
Common Mistakes to Avoid
When shutting down unwanted websites, administrators often make errors that impact other services:
- Forgetting Bindings: If you stop a site and reassign its IP bindings to another site without checking, you might accidentally hijack traffic for other domains. Always check your site bindings.
- Ignoring Logs: Before permanently deleting a site, review your server logs to ensure no critical background services or legacy mobile apps depend on its endpoints.
- Leaving Orphaned App Pools: Stopping a site leaves its application pool running by default in some configurations, which continues to consume server memory. Always clean up matching app pools.
Frequently Asked Questions
What error message do users see when a website is stopped in IIS?
When you stop a website via IIS Manager, visitors typically see a browser-level connection error, such as "Unable to connect" or "The site can't be reached," because IIS stops listening on the assigned ports.
Can I redirect traffic from a shut-down website to a new URL?
Yes. Instead of stopping the site entirely, you can configure the HTTP Redirect module in IIS Manager to send all incoming requests from the old domain to a new, active website seamlessly.
How do I completely remove a website from IIS?
To remove it permanently, open IIS Manager, right-click the website under the Sites folder, and select Remove. Keep in mind this only deletes the IIS configuration; you'll need to manually delete the physical file directory if you want to free up storage space.
Does stopping a website stop its background tasks?
Stopping a website stops incoming web requests, but if your site relies on Windows Services running independently outside of IIS, those services will continue running until you stop them via the Windows Services manager (services.msc).