How to show maintenance page during deployment?
Asked Answered
O

2

21

I want to plan a schedule maintenance down time on one of my production asp.net website hosted on IIS windows server 2003.

I think this is the preferred behavior:

  1. All request to http://www.x.com including www.x.com/asb/asd/ will be redirected to a notification page (site is currently down. come back later)
  2. The maintenance will take around an hour. how do I ensure for having this redirection to maintenance page to have the least impact to SEO/google ranking
  3. Preferrably I want to be able to quietly test the production site before it goes back 'live'
  4. Preferrably I dont want to rely on pointing DNS elsewhere.
  5. To make it simple please pretend that I don't have any other hardware in front of the web servers (i.e load balancer, firewall etc)

An idea would be:

  1. to create another app on the same web server
  2. create httpmodule or httphandler to handle any url request and 302 redirect them to the maintenance page

Thanks

Oshaughnessy answered 4/5, 2009 at 7:58 Comment(1)
Possible duplicate of Redirect site visitors during maintenanceRatha
S
53

Try putting App_Offline.htm to the root directory.

Shurwood answered 4/5, 2009 at 8:2 Comment(11)
@deviant 12 second was probably the amount of time it took you to get the link. upvote for that. thanksOshaughnessy
@AntonGogolev What about a solution for MVC? Unfortunately it did not worked for MVC :(Kilometer
@Clint Eastwood For me works for MVC without any problemsRe
@Re Did you try in a IIS Server? Does it working during a publish process continues?Kilometer
How do I do it only for everyone but myself (identified by cookie, ip address or some other means)? Obviously I need to test the site after updating it.Certified
@Certified - it's quite complicated but you could try this ... thereformedprogrammer.net/…Candiscandle
@AntonGogolev - How does this address the 2nd point of the OP? Couldn't it could have devastating SEO effects for a well-ranking site?Candiscandle
@Candiscandle A well-ranking site should be properly load-balanced and no deployment should take the entire site offline.Shurwood
@AntonGogolev a well-ranking site need not necessarily be a big money-earner. Small businesses or community groups would hardly to be able to afford the specialised expertise required to set up and maintain a load-balanced system. Also, very few Windows web hosts seem to offer load balancing so you'd probably need to be running your own server farm to be able to do this.Candiscandle
@AntonGogolev - I forgot to add a prefix to that to say that "Yes, load-balancing would be ideal. But..." By the time I thought of it 7 minutes had passed so I was unable to edit my comment.Candiscandle
I have an MVC app on Azure IIS and have realized app_offline.htm for MVC might not be the best option. I quickly used app_offline.htm but stylesheets, images, and script files that are referenced could break. For example, IE Edge forces the slash (/) after the end of the domain whereas google chrome does not include the slash. My references broke. For MVC, I think routes need to take charge and not the app_offline.htmNebulize
C
6

copy an app_offline.htm file to the webroot

http://weblogs.asp.net/scottgu/archive/2005/10/06/426755.aspx

Caughey answered 4/5, 2009 at 8:3 Comment(3)
Any solution for MVC please? Unfortunately it did not worked for MVC :(Kilometer
@ChadGrant - How does this address the 2nd point of the OP? Couldn't it could have devastating SEO effects for a well-ranking site?Candiscandle
@Candiscandle From what I gather, the 503 response returned by App_Offline.htm is well-understood by web-crawlers, and shouldn't impact SEO terribly much.Ratha

© 2022 - 2024 — McMap. All rights reserved.