How to redirect a URL in IIS
To redirect a URL in IIS, select the site or folder in IIS Manager, open HTTP Redirect, tick the box to redirect requests and enter the new address. Set the status code to 301 Permanent if the move is for good, then click Apply. If HTTP Redirect isn't in the list, install the HTTP Redirection role service first.
Redirect checkerUpdated 4 min read
These steps follow Microsoft's reference for the httpRedirect element. They apply to IIS 7 and later, including IIS 10 on current Windows Server.
Install HTTP Redirection
Microsoft notes that HTTP Redirection isn't part of a default IIS install. On Windows Server:
- Open Server Manager, then Manage → Add Roles and Features.
- Click through to Server Roles.
- Expand Web Server (IIS) → Web Server → Common HTTP Features and tick HTTP Redirection.
- Click Next, then Install.
On a Windows desktop, open Control Panel → Programs and Features → Turn Windows features on or off, expand Internet Information Services → World Wide Web Services → Common HTTP Features, and tick HTTP Redirection.
Redirect a site or folder in IIS Manager
- Open Internet Information Services (IIS) Manager.
- In Connections, expand the server, then Sites, and select the site, folder or application you're moving.
- In the Home pane, double-click HTTP Redirect.
- Tick the box to redirect requests and enter the new address, for example https://www.example.com/new/.
- Choose the options you need (below), then click Apply in the Actions pane.
The options:
- Exact destination: send every request to the address as typed, instead of adding the rest of the path to it.
- This folder only: redirect requests for the folder itself but not its subfolders.
- Status code: 301 Permanent, 302 Found, 307 Temporary or 308 Permanent Redirect. Microsoft lists Found (302) as the default.
The same redirect in web.config
IIS Manager writes the setting to the site's web.config. You can add it yourself:
<system.webServer>
<httpRedirect enabled="true" destination="https://www.example.com/" httpResponseStatus="Permanent" />
</system.webServer>httpResponseStatus takes Found (302), Permanent (301), Temporary (307) or PermRedirect (308). exactDestination="true" and childOnly="true" match the two tick boxes above.
To redirect particular files, add wildcard rules inside the element. Microsoft's example sends every request for a PHP file to the home page:
<httpRedirect enabled="true" exactDestination="true" httpResponseStatus="Found">
<add wildcard="*.php" destination="/default.htm" />
</httpRedirect>Microsoft notes there's no user interface for wildcard redirects, so these go in web.config by hand.
Redirect or URL Rewrite?
HTTP Redirect is the simple option: one destination per site or folder. For rules based on patterns, such as sending every old product URL to a new path, Microsoft's URL Rewrite module lets you write rules with regular expressions and pick the action. A rule with the Redirect action sends the browser to a new address. A Rewrite action changes the address only inside the server, so the visitor still sees the old one. Search engines only learn about a move from a redirect.
Check the redirect
Paste the old address into the checker. It follows each hop from the outside, as a browser would, and flags any that isn't a permanent 301 or 308. That catches the default 302 if you forgot to change it.
Redirect checker
Open the full toolPick the right status code
The HTTP standard, RFC 9110, defines 301 as a new permanent address that links ought to use from now on, and 302 as a temporary one where the old address stays in use. 307 and 308 are the temporary and permanent versions that keep the request method, which matters when a form posts data. For a page or site that has moved, choose 301 or 308.
When it doesn't work
- No HTTP Redirect icon. The role service isn't installed. Go back to the first section.
- A redirect loop. Redirecting a site to a folder inside itself sends the request round again. Limit the redirect to this folder only, or use the exact destination option.
- Several hops. An old rule points at an address that redirects again. See redirect chains for how to flatten them.
Running Apache instead? See how to redirect a URL with .htaccess.
Sources
- HTTP Redirects <httpRedirect> (Microsoft Learn), checked 2026-11
- Creating Rewrite Rules for the URL Rewrite Module (Microsoft Learn), checked 2026-11
- RFC 9110: HTTP Semantics, section 15.4 Redirection 3xx, checked 2026-11
Questions
How do I redirect a URL in IIS?
Install the HTTP Redirection role service, open IIS Manager, select the site or folder, double-click HTTP Redirect, tick the box to redirect requests, enter the destination, pick 301 Permanent and click Apply.
How do I redirect a URL to a different URL in IIS?
Select the old folder or site in IIS Manager and set its HTTP Redirect destination to the new address. For one file, add a wildcard rule under <httpRedirect> in web.config.
What's the difference between URL Rewrite and a redirect?
A redirect tells the browser to ask for a new address, so the address bar changes. A rewrite changes the address only inside the server: the visitor keeps seeing the original URL.
Why does IIS send a 302?
The HTTP Redirect feature's default status is Found, which is a 302. Choose Permanent (301) or Permanent Redirect (308) in the HTTP Redirect pane if the move is for good.