Mettre une application Web en mode offline

by lgmorand 13. novembre 2009 09:19

Ca fait maintenant quelques année que je fais du .Net et ca fait surtout deux ans que je fais exclusivement des applications Web, ait passé toutes les certifs sur le sujet, lu moulte bouquins et pourtant j'apprend encore des choses.

Cette chose, je veux vous la partager car en en parlant autour de moi, j'ai vu différentes personnes, développeurs ASP.Net également, ne le sachant pas non plus. Il s'agit donc de quelque chose d'éventuellement pas assez connu.

Contexte : un client veut mettre en pause une application, le temps d'évolution. Nous souhaitons alors que toutes les pages du sites soit redirigéés vers une page indiquant "en travaux".

Solution : un seul et unique fichier htm.

En effet, depuis la version 2.0 d'ASP.Net, lorsque vous placez un fichier html contenant le texte de votre choix, nommé app_offline.htm (important le nom!) et que vous le placez à la racine de votre site Web, instantanément et sans redémarrage du site Web, toute requête de ce site est automatiquement redirigée vers cette page.

Il est également important que le fichier fasse AU MOINS 1octet. Si le fichier est vide, il ne sera pas pris en compte.

et voilà, c'est tout :)

Tags: ,

ASP.Net

Commentaires

15/03/2010 09:41:03 #

good good…this post deserves nothing Frown  …hahaha just joking Tong …nice post Tong Big thanks for the useful info i found on Mettre une application Web en mode offline.

pay day loans United States

06/05/2010 09:10:17 #

i need to install hebrew language but i dont have a windows disk what can i do? is there any way to instal the files without the disk? Sorry for my bad english?

she love wide tight belts United Kingdom

13/05/2010 13:30:45 #

I need to extend security in BE just a little. I need to make a user registration form and disable comments for non-registered users. Has anyone done this? What difficulties might arise?

Australian Luxe United Kingdom

04/07/2010 17:09:51 #

I must say, youve got one of the best blogs Ive seen in a long time.  What I wouldnt give to be able to create a blog thats as interesting as this.  I guess Ill just have to keep reading yours and hope that one day I can write on a subject with as much knowledge as youve got on this one!

wow gold Oman

04/07/2010 22:57:40 #

You must know, your article goes to the center of the issue. Your pellucidity leaves me wanting to know more. Allow me to forthwith grab your feed to keep up to date with your web site. Saying thanks is simply my little way of saying what a masterpiece for a special resource. Accept my dearest wishes for your inflowing publication.

Sport Game Kyrgyzstan

05/07/2010 04:28:00 #

was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post.

wow map addon Singapore

06/07/2010 03:15:24 #

Couldn?t be written any better. Reading this post reminds me of my old room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thanks for sharing!

pet pigs Libya

06/07/2010 08:37:11 #

Great article. There's a lot of good information here, though I did want to let you know something - I am running Fedora with the up-to-date beta of Firefox, and the design of your blog is kind of bizarre for me. I can read the articles, but the navigation doesn't function so well.

Wow Gold Europe Spain

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen