65.9K
CodeProject is changing. Read more.
Home

How to put your site into maintainance mode

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.67/5 (3 votes)

Nov 29, 2011

CPOL
viewsIcon

9790

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...