472,954 Members | 2,357 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,954 software developers and data experts.

redirect entire website in .net?

I need to take my website offline for an hour or so while I perform some
maintenance... is it possible to create a 'catch-all' redirect to a
temporary page (i.e. something in Web.config or global.asax.vb) ?

People access my site through several different pages, so I couldn't put
a redirect on the homepage, and taking my server offline is out the
question.

Thanks,
Peter
--

"I hear ma train a comin'
.... hear freedom comin"
Nov 19 '05 #1
8 2446
Point the default document to another place such as SiteDown.htm
instead of Default.aspx. If you want all pages that are referenced to
go there as well delete the entire directory tree and set the 404 Page
not found to the SiteDown.htm as well. You can do all this by right
clicking on the virtual directory in the iis console.

Endo

Nov 19 '05 #2
You can do this rather simply in IIS.

Select Properties of the web application
Goto Virtual Directory Tab
Change radio button to say "A redirection to a URL"
and put in the URL.

If you don't have access to IIS, you could just stick it in Global.asax.vb
in session:

Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("page.aspx")
End Sub

"Stimp" <re*@spumco.com> wrote in message
news:sl****************@carbon.redbrick.dcu.ie...
I need to take my website offline for an hour or so while I perform some
maintenance... is it possible to create a 'catch-all' redirect to a
temporary page (i.e. something in Web.config or global.asax.vb) ?

People access my site through several different pages, so I couldn't put
a redirect on the homepage, and taking my server offline is out the
question.

Thanks,
Peter
--

"I hear ma train a comin'
... hear freedom comin"

Nov 19 '05 #3
If you're using ASP.NET 2.0, all you have to do is place
a file named "app_offline.htm" in your application root directory.

As soon as you do that, ASP.NET 2.0 will shut-down the application,
unload the application domain, and stop processing any new requests
for that application.

ASP.NET will then respond to all requests for the application's
by returning the content of the app_offline.htm file.

If you're using ASP.NET 1.1, what I'd do is unload the application
( in the IIS Manager ), and eliminate the application;s virtual directory.

Then, create a new virtual directory with a default.aspx file
with your "Under Cobstruction" information.

When you're done, dump the under construction app
and reinstate your standard application.

If you have everything prepared, it shgouldn't take
you more than 30 seconds to make the switch.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Stimp" <re*@spumco.com> wrote in message
news:sl****************@carbon.redbrick.dcu.ie...
I need to take my website offline for an hour or so while I perform some
maintenance... is it possible to create a 'catch-all' redirect to a
temporary page (i.e. something in Web.config or global.asax.vb) ?

People access my site through several different pages, so I couldn't put
a redirect on the homepage, and taking my server offline is out the
question.

Thanks,
Peter
--

"I hear ma train a comin'
... hear freedom comin"

Nov 19 '05 #4
On Thu, 13 Oct 2005 bc******@gmail.com <bc******@gmail.com> wrote:
Point the default document to another place such as SiteDown.htm
instead of Default.aspx. If you want all pages that are referenced to
go there as well delete the entire directory tree and set the 404 Page
not found to the SiteDown.htm as well. You can do all this by right
clicking on the virtual directory in the iis console.


unfortunately I'm using a shared hosting account, so I can't get access
to IIS.

If I contact the support desk to do it, it could be 5 hours before they
respond to put the site back live.

Ah well, I'll write a redirect on every page so.

Thanks.
--

"I hear ma train a comin'
.... hear freedom comin"
Nov 19 '05 #5
On Thu, 13 Oct 2005 Jeff Sheldon <sh******@penn-america.com> wrote:
You can do this rather simply in IIS.

Select Properties of the web application
Goto Virtual Directory Tab
Change radio button to say "A redirection to a URL"
and put in the URL.

If you don't have access to IIS, you could just stick it in Global.asax.vb
in session:

Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("page.aspx")
End Sub

that sounds like what I'm looking for. Thanks!

--

"I hear ma train a comin'
.... hear freedom comin"
Nov 19 '05 #6
Very neat solution. Thanks!

I like that!
Although I like the ASP.NET 2.0 solution even more.

;-)


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Jeff Sheldon" <sh******@penn-america.com> wrote in message
news:Oc**************@TK2MSFTNGP14.phx.gbl...
You can do this rather simply in IIS.

Select Properties of the web application
Goto Virtual Directory Tab
Change radio button to say "A redirection to a URL"
and put in the URL.

If you don't have access to IIS, you could just stick it in Global.asax.vb in session:

Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("page.aspx")
End Sub

"Stimp" <re*@spumco.com> wrote in message
news:sl****************@carbon.redbrick.dcu.ie...
I need to take my website offline for an hour or so while I perform some
maintenance... is it possible to create a 'catch-all' redirect to a
temporary page (i.e. something in Web.config or global.asax.vb) ?

People access my site through several different pages, so I couldn't put
a redirect on the homepage, and taking my server offline is out the
question.

Thanks,
Peter
--

"I hear ma train a comin'
... hear freedom comin"


Nov 19 '05 #7
Another cute way to do this would be to alter the web.config file to deny all
and use the loginUrl to Sitedown.aspx (or something like that). Doesn't even
require a recompilation:

=-=-=-=-
<!-- AUTHENTICATION
This section sets the authentication policies of the application. Possible
modes are "Windows", "Forms", "Passport" and "None"
-->
<authentication mode="Forms">
<forms loginUrl="sitedown.aspx" protection="All" timeout="30">
</forms>
</authentication>

<authorization>
<deny users="*" />
</authorization>
=-=-=-=-

(I hope this shows up right, I'm still getting used to when you have to use
special characters or not).
--
brians
http://www.limbertech.com
"Stimp" wrote:
I need to take my website offline for an hour or so while I perform some
maintenance... is it possible to create a 'catch-all' redirect to a
temporary page (i.e. something in Web.config or global.asax.vb) ?

People access my site through several different pages, so I couldn't put
a redirect on the homepage, and taking my server offline is out the
question.

Thanks,
Peter
--

"I hear ma train a comin'
.... hear freedom comin"

Nov 19 '05 #8
Good idea, Brian.

I assune you would *not* include login textboxes in sitedown.aspx.

;-)

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"brians[MCSD]" <br********@discussions.microsoft.com> wrote in message
news:18**********************************@microsof t.com...
Another cute way to do this would be to alter the web.config file to deny all
and use the loginUrl to Sitedown.aspx (or something like that). Doesn't even
require a recompilation:

=-=-=-=-
<!-- AUTHENTICATION
This section sets the authentication policies of the application. Possible
modes are "Windows", "Forms", "Passport" and "None"
-->
<authentication mode="Forms">
<forms loginUrl="sitedown.aspx" protection="All" timeout="30">
</forms>
</authentication>

<authorization>
<deny users="*" />
</authorization>
=-=-=-=-

(I hope this shows up right, I'm still getting used to when you have to use
special characters or not).
--
brians
http://www.limbertech.com
"Stimp" wrote:
I need to take my website offline for an hour or so while I perform some
maintenance... is it possible to create a 'catch-all' redirect to a
temporary page (i.e. something in Web.config or global.asax.vb) ?

People access my site through several different pages, so I couldn't put
a redirect on the homepage, and taking my server offline is out the
question.

Thanks,
Peter

Nov 19 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sentinel | last post by:
here is the entire thread From: "Kimmo Laine" <eternal.erectionN0.5P@Mgmail.com> Subject: Re: script in body Date: Mon, 20 Jun 2005 17:46:28 +0300 Message-ID:...
3
by: Mr B | last post by:
Howdy all, I have 2 domain names that both go to the same website. For example, if www.XXXX.com is the primary name for the website, if you type in www.XXXX.com or www.YYYY.com, they both go...
8
by: Victor | last post by:
I need to redirect to another web page, but that redirect will include the submission of form data. So, unlike ServerXMLHTTP which stays on the originating web page, I need the script to redirect...
5
by: sck10 | last post by:
Hello, Using ASP.NET 2.0 I have two websites: www.OldSite/Old01/ www.NewSite/New01/ I need to redirect everything in the folder "Old01" to "New01". The folder "Old01" has 15+ web pages...
5
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks...
21
by: John | last post by:
Hi, I updated a site and changed the file extensions from .html to .php. Now i noticed that the google does find the old .html pages but since they're not there anymore... they can't be found....
3
by: glezaber | last post by:
Hi, I´ve two websites stored in IIS 5.0, and what I want is to Redirect from A website to B website, the problem is that doesn´t work because if I use Response.Redirect (http://localhost:5080)...
56
by: UKuser | last post by:
Hi, I'm not sure if this can be done as I've searched the web and this forum. I am using an online merchant provider and I must post certain variables to their webforms through a form on my...
3
by: ykhamitkar | last post by:
Hi there, I have created a website and now my client wants me to createa a form which should be mandatory and unless the user fills up the form he/she can not go to any of the URL/Link in the web...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
1
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.