473,466 Members | 1,381 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Reading al URL information for redirect

Hi there,
I have a number of domain names and they all point to the same IP address. I
would like to redirect to a specific folder, based on the domain name used
to access the site.
For example. www.root.com - points to the main default page.
www.otherroot.com would need to use the default page in a specified folder.

My ISP is not able to help here by allocating new IP addresses to the
subfolders of the main site. Something to do with the way IIS works. I have
a huge amounts of flash animations (some 200 meg) that need to be served up
and I do not want to have to duplicate them in other folders.

Is there a way in ASP to code the root default page to redirect based on the
URL?

Any assistance would be of great help.

Thanks
Hans
Jul 19 '05 #1
3 1860
Hans wrote on 16 mrt 2004 in microsoft.public.inetserver.asp.general:
Hi there,
I have a number of domain names and they all point to the same IP
address. I would like to redirect to a specific folder, based on the
domain name used to access the site.
For example. www.root.com - points to the main default page.
www.otherroot.com would need to use the default page in a specified
folder.

My ISP is not able to help here by allocating new IP addresses to the
subfolders of the main site. Something to do with the way IIS works. I
have a huge amounts of flash animations (some 200 meg) that need to be
served up and I do not want to have to duplicate them in other
folders.

Is there a way in ASP to code the root default page to redirect based
on the URL?

start your 404.asp file with:

<%
qstr = lcase(Request.ServerVariables("QUERY_STRING"))

transferToDir("mySite.com", "mysitedirs")
transferToDir("123.123.123.123", "yoursitedirs")
transferToDir("hisSite.com", "hissite/dirs")

function transferToDir(from,to)
from1 = "404;http://" & from & ":80"
if instr(qstr,from1)<>1 then exit function

frol1len = len(from1)
server.transfer "/" & to & mid(qstr,from1len)
end function
%>

NOT TESTED, just the idea!!!
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #2
Hi Evertjan,

Thanks but I cannot access the 404.asp page. I am hosted on a shared server
and would like to code the header of the index.asp page of the site with
something that will redirect based on the URL entered.
I am not that clued up with scripting and not sure how to determine what the
URL content would be.

I tried experimenting with your sample code and still could not get the URL
that was entered to open the site.

Thanks
Hans

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Hans wrote on 16 mrt 2004 in microsoft.public.inetserver.asp.general:
Hi there,
I have a number of domain names and they all point to the same IP
address. I would like to redirect to a specific folder, based on the
domain name used to access the site.
For example. www.root.com - points to the main default page.
www.otherroot.com would need to use the default page in a specified
folder.

My ISP is not able to help here by allocating new IP addresses to the
subfolders of the main site. Something to do with the way IIS works. I
have a huge amounts of flash animations (some 200 meg) that need to be
served up and I do not want to have to duplicate them in other
folders.

Is there a way in ASP to code the root default page to redirect based
on the URL?

start your 404.asp file with:

<%
qstr = lcase(Request.ServerVariables("QUERY_STRING"))

transferToDir("mySite.com", "mysitedirs")
transferToDir("123.123.123.123", "yoursitedirs")
transferToDir("hisSite.com", "hissite/dirs")

function transferToDir(from,to)
from1 = "404;http://" & from & ":80"
if instr(qstr,from1)<>1 then exit function

frol1len = len(from1)
server.transfer "/" & to & mid(qstr,from1len)
end function
%>

NOT TESTED, just the idea!!!
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jul 19 '05 #3
Hans wrote on 16 mrt 2004 in microsoft.public.inetserver.asp.general:
Thanks but I cannot access the 404.asp page. I am hosted on a shared
server and would like to code the header of the index.asp page of the
site with something that will redirect based on the URL entered.
I am not that clued up with scripting and not sure how to determine
what the URL content would be.


[please do not toppost on usenet]

That is the second possiblity, to include a smaal file at the top of each
asp file. However the non asp files like .jpg will be common.

<%
host = lcase(Request.ServerVariables("HTTP_HOST"))

transferToDir("mySite.com", "/mysitedirs")
transferToDir("123.123.123.123", "/yoursitedirs")
transferToDir("hisSite.com", "/hissite/dirs")

function transferToDir(from,to)
if instr(host,from1)<>1 then exit function
server.transfer to & Request.ServerVariables("URL")
end function
%>

also NOT TESTED, just the idea!!!

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #4

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

Similar topics

1
by: Google Mike | last post by:
Tell me if this can be done, and if I have a misconception here. I am writing an app that will be served up in an app farm, and therefore I need to move the session information to the client, not...
3
by: Google Mike | last post by:
Gosh. I posted this earlier on Google Groups, but it didn't appear. Perhaps there was a problem at Google. Forgive me for posting it again. This time, I'll be more brief. Instead of using...
4
by: Hilary Cotter | last post by:
Thanks for all the help you gave me yesterday. here is another question. I have a comma delimited file called redirect.txt which looks like this test, /test.htm test 123,/test123.htm
5
by: francois | last post by:
I would like to pass information between ASPX pages. For now, my navigation are hardcoded links. In some case I do a Response.Redirect("pages.aspx") Now I wonder is this is a good way to do. ...
9
by: Paul | last post by:
What I am trying to do is as follows. I have a page with 3 links,that direct the user to 3 different pages when selected after login. So all link selections will first direct the user to a login...
1
by: Cammie Watson | last post by:
Hi there, I have an .aspx page which I use to gather various pieces of information from the user. One of the fields is a free text field for address or optionally the user can type in a...
3
by: Fred Nelson | last post by:
Hi: I have a VB.NET web app and in one section I'm creating a datagrid that lists several id's and names - I would like to be able to send the user to another web page if only one record matches...
3
by: maya | last post by:
yes I know, this has been asked many times, but I don't quite the answers: usu. answers are to put the redirect code -- in my case $URL =...
0
by: ashes | last post by:
Hi all, In Ms Access, I have a Customer table and a Credit Card table. The CustomerID field is a primary key in the Credit Card table. Both tables already have sample data in it. So, when a...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.