473,406 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Redirect multiple domains pointing to the same folder

I like the Web hosting site I'm using (though alternate hosting suggestions are welcome), and it allows me to point mulitple domains to the root folder for free, but it charges extra for pointing them to folders.

But here's my issue:

If I could just point each domain to a different folder, then every site is self-contained. But in my case, they will all be pointing to the same (root) folder.

What I'm looking for is a way to have Site1.com and Site2.com, both pointing to the 'Root' folder, transparently be redirected/transferred to folders 'Roots/Site1' and 'Root/Site2' (effectively making it look like the domains were actually pointing to the folders even though they really aren't).

I can use .NET Framework 1.1 or 2.0 (though I haven't had a chance to play with 2.0 yet), and I prefer to use C#.

Thanks.
Greg
Feb 21 '06 #1
3 2056
Could you have something like...

string host = Request.ServerVariables("HTTP_HOST");

if (host == "site1.com" || host == "www.site1.com")
{
Response.Redirect("http://www.site1.com/site1");
}
else
{
Response.Redirect("http://www.site2.com/site2");
}

This would be the root application. Is your host webhost4life? Prices
for what you are saying sounds familiar...

HTH,
Darren Kopp
http://blog.secudocs.com/

Feb 21 '06 #2
Yes, I'm using WebHost4Life. I've searched around for others, but this one seems pretty solid and keeps up-to-date with things.

I've looked at Response.Redirect, but was hoping for something more transparent, as if I were actually pointing the domain to the folder.

I'd like the users to be able to use URLs such as "http://www.site1.com/foo/bar/default.aspx" while transparently in the background, the server would serve up "http://www.site1.com/site1/foo/bar/default.aspx".

There has to be some way to do this so that the user doesn't have an extra folder listed in the address, and doesn't need to ever know about the extra folder.

Ideas?
Feb 21 '06 #3
Well, it's possible, but i'm not sure if it's possible for you since
you are on a shared webhost. Even if you had your own server, it would
not be worth it through asp.net, but then again if you had your own
server you wouldn't be in this problem. The only route you will
probably be able to go is to have 1 application, but serve up different
content based on the url, similar to a portal application. I doubt
that's what you want to do, but that's about all you can do. Maybe
have each applicaiton do some url rewriting to make it look more
consistent?

If it were me, I would just make the folder seem like that's where they
need to be (like NetApp or somethin).

Best of luck with what you decide to do,
Darren Kopp
http://blog.secudocs.com/

Feb 23 '06 #4

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

Similar topics

5
by: Jay Shen | last post by:
Hi, I have two domains pointing to the same ISP hosted web site. How can I redirect request for www.domain2.com to a sub-folder using header field "host"? Thanks a lot... J-
1
by: Damo | last post by:
Could someone please help me. I am a newbie at PHP. I downloaded formail.php Version 5.0 from Jacks scripts( http://www.dtheatre.com/scripts/ )and changed the required areas to my email address and...
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...
11
by: Vic Spainhower | last post by:
Hello, I just purchased a new domain name and I've set it up as a redirect to a folder on my main site. What is happening is the index.php page checks a session variable to see if the user is...
2
by: FN | last post by:
I'm using User.Identity.IsAuthenticated on all my pages (from a base class), and redirecting to a login page if not authenticated. The problem is that some pages are in subfolders and others are...
1
by: John | last post by:
Hi, I have a routine that sets some session variables and then redirects the user to another page in the same application/ same folder. ======= Session("MyName") = "Fredsmith"...
1
by: c_web | last post by:
Hi i have several domains www.domain1.com www.domain2.com www.domain3.com all the domains maps to the same directory in my hosting provider IIS server lets say : c:\sites\myaccount\
6
by: Ludvig | last post by:
I have various domains using the same application/assembly They differ in contents and design, based on a "site id", and get its information from an SQL server. Now I have to deploy the...
18
by: BDE Consulting | last post by:
I am going crazy. This has been a problem now for over a year and I have yet to figure out what is causing it. I have a single server that is running multiple domains. For this example I will...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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...

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.