response.redirect to redirect domain names to subwebs

C

Chris

Folk

My MS web host tells me I have to use some script to redirect domain names to sub-webs/directories within my web, if I am to retain MS Frontpage functions

I've tried following their (inadequate) instructions but to no avail, and their support service is no help either (surprise !!)

Can anyone advise

What I've done is

1. Created new page in the root directory of my web and named that page default.as

2. I've deleted all html coding in the page and replaced it with an edited version of the script the host provides

<
EnableSessionState=Fals
host = Request.ServerVariables("HTTP_HOST"
if host = "ABC.net" or host = "www.ABC.net" the
response.redirect("http://XYZ.co.uk/subdirectory1/default.htm"
elseif host = "DEF.co.uk" or host = "www.DEF.co.uk" the
response.redirect("http://XYZ.co.uk/subdirectory2/default.htm"
elseif host = "GHI.co.uk" or host = "www.GHI.co.uk" the
response.redirect("http://XYZ.co.uk/subdirectory3/default.htm"
els
' if we get no host or undefined hos
response.redirect("http://XYZ.co.uk/default.htm"
end i
%

3. I've saved that page and uploaded to my web (whilst retaining the default.htm page in the root directory also

Any ideas ? Sorry - but I'm an absolute beginner on ASP coding etc !

Many thanks !

Chri
 
J

Jon

Hi Chris,
you'd have something like this
<%
strHost = lcase(request.servervariables("SERVER_NAME"))
if instr(strHost, "abc.net") > 0 then
response.redirect "FolderForabc.net"
elseif instr(strHost, "def.net") > 0 then
response.redirect "FolderFordef.net"
' etc
end if
%>
Stick this code in default.asp. You should also lose this line
EnableSessionState=False

Some of the FP database features use sessions so this line would break them.

Jon
Microsoft MVP - FP

Chris said:
Folks

My MS web host tells me I have to use some script to redirect domain names
to sub-webs/directories within my web, if I am to retain MS Frontpage
functions.
I've tried following their (inadequate) instructions but to no avail, and
their support service is no help either (surprise !!).
Can anyone advise ?

What I've done is :

1. Created new page in the root directory of my web and named that page default.asp

2. I've deleted all html coding in the page and replaced it with an edited
version of the script the host provides :
<%
EnableSessionState=False
host = Request.ServerVariables("HTTP_HOST")
if host = "ABC.net" or host = "www.ABC.net" then
response.redirect("http://XYZ.co.uk/subdirectory1/default.htm")
elseif host = "DEF.co.uk" or host = "www.DEF.co.uk" then
response.redirect("http://XYZ.co.uk/subdirectory2/default.htm")
elseif host = "GHI.co.uk" or host = "www.GHI.co.uk" then
response.redirect("http://XYZ.co.uk/subdirectory3/default.htm")
else
' if we get no host or undefined host
response.redirect("http://XYZ.co.uk/default.htm")
end if
%>

3. I've saved that page and uploaded to my web (whilst retaining the
default.htm page in the root directory also)
 

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

Top