Register  |  Login




Advertisement

Start Your Own Q&A Site

Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.

Question

Status: Closed Points: 25 Time: 13:57 - Jun 26, 2008  

dave

how do i set my asp.net site to show a maintenance page, while it's offline?

is there any way to do this though the web.config file?

Categories

Answer Discussion
Tutorials

 

PeterNZ

Date:: Jun 29, 2008

Time:: 16:31

These are the steps you should do:

Develop the page you want to show while your page is offline.
Deploy this webpage to your webserver i.e. to an error subfolder

Add this to your web.config:

<configuration>
<system.web>
<customErrors defaultRedirect="/errors/default.aspx" mode="RemoteOnly">
<error statusCode="404" redirect="/errors/404.aspx" />
</customErrors>
</system.web>
</configuration>

If a web page is unreachable the server throws a 404 error. With the above steps you redirect the standard error page to your custom error page. The "Remote Only" setting avoids that you see this page if you access the web page locally i.e. when you are logged on to your server.

If you need to redirect to custom error pages for other codes, do the same as above. Here is a list of all HTTP status codes: http://en.wikipedia.org/wiki/List_of_HTT...

Hope this helps

Cheers

Peter

dave

Date:: Aug 03, 2008

Time:: 04:11

Thanks Peter.
I was using the customerrors configuration in the web.config, but what I wanted was a way (in the web.config?) to set the site to "offline" so that any request, not only the errors would be redirected to a specific maintenance page.
I didn't find a solution so I ended up just changing the normal error page to a maintenance page, but I don't think it's very elegant.

admin

Date:: Mar 04, 2009

Time:: 10:09

The question looks to be abandoned by the user who asked it. If no action is taken within 2 days, a Quomon Moderator will consider closing the question and distributing the points.

The Quomon Team

dave

Date:: Mar 04, 2009

Time:: 10:53

I actually found a solution afterwards.
Uploading a file called app_offline.htm in the root of the asp.net 2 directory will automatically shut the site down only showing this page until it's removed again.
Very easy and very useful.

Question Answered

This question has been closed, and points have been rewarded to the following experts:


PeterNZ: 5
dave: 20

You're welcome however to comment or give additional information or if you wish, you have the ability to write a Tutorial in the Tutorial Area.

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

No tutorials have been submitted yet. Want to be the first?

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top Experts

View More

Rank

Expert

Points

1.

nidhi

10354

2.

oracleofDelphi

6493

3.

rcastagna

5596

4.

LAGM

4848

5.

PeterNZ

3487

6.

gonzalo

2840

7.

Mason

2770

8.

jgivoni

2303

9.

xarcus

1820

10.

Anpanman

917

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es