Redirect application on IIS when pool is stopped

Asked

Viewed 130 times

0

I have an ASP.NET C# application that is updated by another application on the server.

When I start the process of updating the first application in the second I stop the pool in which the first one is running. At this point I would like to enable some way to redirect the first application to a page on the second stating that the update process is going on.

I tried using the tag httpRedirect on web.config, I also tried using the file app_offline.htm at the root of the first application but in both cases the pool needs to be active to perform the redirect, which is not the situation I have.

Does anyone have any idea how I can perform the redirect with the pool on IIS stopped?

  • 1

    In addition to stopping the original pool, you can’t edit Binding for a temporary pool and or remap the site to another directory?

  • That I didn’t get to try, edit the Binding vc speaks change the physical directory of the application?

  • You’d have to change the pool even if you didn’t, no matter where you point the site it wouldn’t answer

  • The Apppool stopped returns a 503 error when accessed. These errors can be handled by using a specific page with a friendly message, now if you really want to redirect the site, you need to use the url redirector, the URL Rewriter, you can read more here about how to use: https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module

  • @Leandroangelo I believe I will have to do this, delete the application and create again later. I tried to put some rules of redirection according to the orientation of Ricardo and it did not work very well, the answer remains the error 503.

  • Create in IIS a pool for updates and the application that does the update should follow the following steps: Change pool to provisional > publish app_offline.htm > restart site > stop original pool > copy files > return to original pool > remove app_offline.htm > restart site

  • I did a test and I think this will be the easiest solution to the situation I have, I appreciate the quick help from you friends.

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.