Web site not available

S

sweetpotatop

Hello,

I have a site created by asp net, due to the weekend construction, this
particular site need to be shut down during the weekend.

I wonder if there is a quick way to have a page or whatever method
(without recompiling the whole apps), so that when users try accessing
the page, they will will be prompt that the site is not currently
available.

One of my concern is since ppl work on Friday until the end of the day,
but I don't, not even weekend. Is there a solution where I can
pre-schedule it to stop on Sat morning? (or maybe in the IIS?)

Thanks in advance. Your help would be greatly appreciated.
 
J

Juan T. Llibre

All you have to do is put a file named

App_offline.htm

in the Application's directory.

ASP.NET will detect its presence and any requests for any/all
pages in the application will cause that page to be displayed.

Put any information you want your users to know in that page.

Use only "standard HTML" in that page...no scripting or objects.
 
S

sweetpotatop

Thanks,

What do you have by the Application's directory? Do you mean the
directory or folder where all my aspx, aspx.vb sit? I've tried that,
but there is not difference.
 
M

Mark Rae

All you have to do is put a file named

App_offline.htm

in the Application's directory.

Is it OK to leave the file in the app root permanently and rename it, say,
to zApp_offline.htm while the site is running normally?

Or should it be deleted when not required?
 
R

Ray Booysen

Thanks,

What do you have by the Application's directory? Do you mean the
directory or folder where all my aspx, aspx.vb sit? I've tried that,
but there is not difference.
You have to be running the application under ASP.NET 2.0
 
J

Juan T. Llibre

re:
Is it OK to leave the file in the app root permanently and rename it, say, to zApp_offline.htm
while the site is running normally?

Yes. Renaming is probably the best way to go.

I rename mine to App_offline.htm.bak but any renaming will do.

re:
Or should it be deleted when not required?

You never know when you'll need it again, so keep it around.
 
J

Juan T. Llibre

re:
You have to be running the application under ASP.NET 2.0

Thanks, Ray.

I should have pointed that out.

For ASP.NET 1.1, the usual route is to have a directory which only has
a single default document with the maintenance info, and redirect all 404's
to the default document.

Then, using the IIS Manager, change the main application's virtual directory
to point to the single-page directory's physical directory.

When you're done, change it back.

There's more complex ways to do this in 1.1, but that works OK.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top