Best way to disable a site?

V

VB Programmer

I have a 50 page site. How can I temporarily redirect everything to a page
that says "This Website Is Currently Down"?

Thanks.
 
V

VB Programmer

What if they bookmarked one of the existing pages? I need all pages to be
redirected, not just a redefinition of the "default" page.

Thanks.
 
A

Aaron Corcoran

VB Programmer,

One thing you could do is to create a simple user control that would
host some code assisting with your redirect. Although it would entail
having to touch each of the fifty pages in your collection, this type
of implementation would allow you to modify the code at any time
without worries.

Again, I am unsure if this is the best method, but it would work.

Another option would be the IIS option. You could change the 404 error
page, for example, to forward them to a specified maintenance page.
The downside is that this would be universal, so if you had any other
sites or applications on that server, than any 404 errors would also
redirect them to the maintenance page. This would not be a recommended
solution unless that is the only application on that IIS Web.

I hope this helps,
Aaron
 
B

bradley

Enable forms authentication in web.config and have it use a form called
websitedown.aspx instead of login.aspx that simply displays your message
with no controls. Attempts to load any form in your website would redirect
to websitedown.aspx, it requires no additional programming, and can be
disabled / enabled by modifying a few lines of configuration.
 
A

Aaron Corcoran

Bradley.

Ahh great idea in using the built in functionality for the login! I'll
have to remember that.

Aaron
 
S

snt

Ok, I was wrong on that.

I am not sure if web.config approach will take care of it when the
resoures are not aspx, asp, htm etc. , eg, pdf (in case you have them
in your site). If yes, thats not a bad idea.

Another way you can accomplish this is by creating another another
folder with only the page (sitedown.htm) you want to show to the user
and configuring IIS to redirect to this page on 'page not found' error.
Hope this helps

snt
 
T

TJS

if you have common header or footer file then you could put something in
there to redirect the user to a "site - down" page
 
A

Alan Silver

I have a 50 page site. How can I temporarily redirect everything to a page
that says "This Website Is Currently Down"?

How about creating a new folder with just a single page in it that gives
the message. Then change the config of IIS to use that folder for the
web site instead of the real one, and that page for all 404s.

That way, any and all page requests (whether static HTML, ASP or
ASP.NET, whether genuine URLs or errors) get passed to this one page.

No offence to anyone else's suggestions, but this is way simpler than
the other ideas ;-)
 

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
474,434
Messages
2,571,691
Members
48,796
Latest member
Greg L.

Latest Threads

Top