rbhatup rbhatup - 1 month ago 13
ASP.NET (C#) Question

Easy way to redirect page when site not available?

We have a regular

asp.net
website. I started debugging several errors, so the website cannot be used (but is not down). Since the default page is not
Default.aspx
and users are used to going directly to
Main.aspx
, 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
web.config
or some
IIS 6
configuration?

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

Thanks.

Answer

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.

https://forums.iis.net/t/1152788.aspx?Put+website+in+maintenance+mode

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

Comments