Conditional Page Re-direct

M

Mona Syed

Hello,

I have a 'primary' intranet website and a 'secondary' backup of this site as
well. I would like to programmatically have the effect that if the
primary site is (page not found 404) not available, for it to access the
secondary site or at least be able to add a message with (or instead of) the
404 error dialog that the primary site is down and give the user a link to
the alternative (secondary) site.

Appreciate your help.
 
R

Ray at

Create a custom 404 page for your site.
(http://www.aspfaq.com/show.asp?id=2162)

You could probably use code as so:

<%

Const SITE1="www.site1.com"
Const SIT22="www.size2.com"

Dim sSite
sSite = LCase(Request.ServerVariables("SERVER_NAME"))
If Not Left(sSite, 4) = "www." Then sSite = "www." & sSite

If sSite = SITE1 Then
Response.Write "That page wasn't found. Maybe try <a href=""http://" &
SITE2 & REquest.ServerVariables("URL") & """>here</a>."
Else
Response.Write "That page wasn't found on this site either. Sorry about
that.
End If

%>

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,141
Messages
2,570,818
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top