Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / web / HTML

How to put your site into maintainance mode

2.67/5 (3 votes)
29 Nov 2011CPOL 9.8K  
How to put your site into maintainance mode
First of all, create an instance of Uri object, then check if the URL provided matches with the URL you are having, then redirect it to the new URL.

Uri uri = new Uri("http://www.google.co.uk/index.html");
if(uri.Host.ToLower().EndsWith("google.co.uk"))
{
//Do something
response.redirect("www.newsite.com/maintainance.html");
}


Enjoy programming...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)