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
|
|
Expert:
|
PeterNZ
|
|
Date:
|
Jun 29, 2008
|
|
Time:
|
16:31
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
|
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.
|
|
Expert:
|
dave
|
|
Date:
|
Aug 03, 2008
|
|
Time:
|
04:11
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
|
|