MARKDOWN 99
Untitled Guest on 22nd October 2024 03:44:10 PM

To automatically redirect every request to / (root) to /login in an IIS (Internet Information Services) environment with .NET, you can do this by adding a redirect rule in your web.config file. Here's how to set it up:

  1. Open your web.config file, which is located in the root of your web application.

  2. Inside the section, add a rewrite rule like the following:

Explanation:

matches the root URL / (an empty string after the domain).

performs a 301 permanent redirect to /login.

This ensures that only the root (/) is redirected to /login, and requests to other URLs like /t will not be affected.

Hightechrobo bin is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.