3

I have a classic ASP application hosted on IIS. I want the site to be inaccessible while I make some changes, and would like to implement something similar to app_offline that we use in ASP.NET.

But app_offline.htm doesn't seem to work for classic ASP

2 Answers 2

3

Many use one big-honking Include file with a set of functions used all over the site... at the top of this file, set a variable to indicate when maintenance is being performed or the site is otherwise unavailable, then test for the value before doing any other thing... if "down", server.transfer or response.redirect to your special "site unavailable" page.

Dim doMaintenance, RightNow, MaintenanceStart, MaintenanceEnd doMaintenance = False MaintenanceStart = CDate("6/18/2015 3:00pm") MaintenanceEnd = CDate("6/18/2015 5:00pm") RightNow = Now() If RightNow > MaintenanceStart and RightNow < MaintenanceEnd Then doMaintenance = True If doMaintenance Then Server.Transfer "otherpage.asp" 

Hope this helps!

Sign up to request clarification or add additional context in comments.

Comments

0

make additional web site, with the same binding like in primary web site and run it while you stop primary web site for maintenance. during all other time additional web site should be stopped.

But app_offline.htm doesn't seem to work for classic ASP

ASP is not ASP.NET.

if application pool or web site stopped you cannot get any page from web sige.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.