rbhatup rbhatup - 10 months ago 50
ASP.NET (C#) Question

Easy way to redirect page when site not available?

We have a regular

website. I started debugging several errors, so the website cannot be used (but is not down). Since the default page is not
and users are used to going directly to
, if anyone goes to http://network:1332/Main.aspx, the person should be redirected to Issues.htm.

Is there an easy to do this without having to alter Main.aspx or write any code? Maybe change
or some

I just don't want anyone to use the website even though the site is available for use.


Answer Source

If you have an ASP.NET web application site, and you place a text file named "app_offline.htm" in the root of the site, all requests to that website will redirect to that app_offline.htm file. Basically, if you need to take an entire ASP.NET site offline, you can place some nice message in that file.


Be warned you too will be directed to the maintenance page, so if you're debugging in production this could make things more difficult.