How do I point a sub-domain to a sub-directory or sub-web of my site using
asp.net?
I know normally domains are setup to point to the root directory of the web
site. However, how can I detect which URL a person is browsing to on my site
with ("such as leon.mydomain.com"), and redirect them to the appropriate
place on within site ("such as mydomain.com/help/leon05"), and where do I
want to put this code in default page of the website or in the global.asax
file.
Thanks! 11 1555
Request.ServerVariables will help u to identify about User's Request.
(URL, file, Path, Physical location etc ).
HTH
Regards,
Jignesh Desai www.dotnetjini.com
"Leon" <vn*****@msn.com> wrote in message
news:uF**************@TK2MSFTNGP09.phx.gbl... How do I point a sub-domain to a sub-directory or sub-web of my site using asp.net?
I know normally domains are setup to point to the root directory of the
web site. However, how can I detect which URL a person is browsing to on my
site with ("such as leon.mydomain.com"), and redirect them to the appropriate place on within site ("such as mydomain.com/help/leon05"), and where do I want to put this code in default page of the website or in the global.asax file.
Thanks!
You need to configure a new website in IIS and it can use the HTTP host header
to distinguish which website to access. Then in your second website configure
to map to any directory you want to.
-Brock
DevelopMentor http://staff.develop.com/ballen How do I point a sub-domain to a sub-directory or sub-web of my site using asp.net?
I know normally domains are setup to point to the root directory of the web site. However, how can I detect which URL a person is browsing to on my site with ("such as leon.mydomain.com"), and redirect them to the appropriate place on within site ("such as mydomain.com/help/leon05"), and where do I want to put this code in default page of the website or in the global.asax file.
Thanks!
something like this would work right?
<%
sname = Request.ServerVariables("SERVER_NAME")
sname = ucase(sname)
if InStr(sname,"DOMAIN1") <> 0 then
response.redirect "subdirectory to go to"
elseif InStr(sname,"DOMAIN2") <> 0 then
response.redirect "2nd subdirectory to go to"
end if
%>
"Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message
news:17*********************@msnews.microsoft.com. .. You need to configure a new website in IIS and it can use the HTTP host header to distinguish which website to access. Then in your second website configure to map to any directory you want to.
-Brock DevelopMentor http://staff.develop.com/ballen How do I point a sub-domain to a sub-directory or sub-web of my site using asp.net?
I know normally domains are setup to point to the root directory of the web site. However, how can I detect which URL a person is browsing to on my site with ("such as leon.mydomain.com"), and redirect them to the appropriate place on within site ("such as mydomain.com/help/leon05"), and where do I want to put this code in default page of the website or in the global.asax file.
Thanks!
Yes, I suppose that would work. The downside is that you'd have to code this
for every page, I presume? And what happens when you want to support a 3rd,
4th or 5th domain? Again, there are always two ways to skin a cat. I'd suggest
seeking out the sharper knife, though ;)
-Brock
DevelopMentor http://staff.develop.com/ballen something like this would work right?
<% sname = Request.ServerVariables("SERVER_NAME") sname = ucase(sname) if InStr(sname,"DOMAIN1") <> 0 then response.redirect "subdirectory to go to" elseif InStr(sname,"DOMAIN2") <> 0 then response.redirect "2nd subdirectory to go to" end if %> "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message news:17*********************@msnews.microsoft.com. ..
You need to configure a new website in IIS and it can use the HTTP host header to distinguish which website to access. Then in your second website configure to map to any directory you want to.
-Brock DevelopMentor http://staff.develop.com/ballen How do I point a sub-domain to a sub-directory or sub-web of my site using asp.net?
I know normally domains are setup to point to the root directory of the web site. However, how can I detect which URL a person is browsing to on my site with ("such as leon.mydomain.com"), and redirect them to the appropriate place on within site ("such as mydomain.com/help/leon05"), and where do I want to put this code in default page of the website or in the global.asax file.
Thanks!
maybe I should just do just a domain redirect form where the domain name is
parked?
"Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message
news:20*********************@msnews.microsoft.com. .. Yes, I suppose that would work. The downside is that you'd have to code this for every page, I presume? And what happens when you want to support a 3rd, 4th or 5th domain? Again, there are always two ways to skin a cat. I'd suggest seeking out the sharper knife, though ;)
-Brock DevelopMentor http://staff.develop.com/ballen
something like this would work right?
<% sname = Request.ServerVariables("SERVER_NAME") sname = ucase(sname) if InStr(sname,"DOMAIN1") <> 0 then response.redirect "subdirectory to go to" elseif InStr(sname,"DOMAIN2") <> 0 then response.redirect "2nd subdirectory to go to" end if %> "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message news:17*********************@msnews.microsoft.com. ..
You need to configure a new website in IIS and it can use the HTTP host header to distinguish which website to access. Then in your second website configure to map to any directory you want to.
-Brock DevelopMentor http://staff.develop.com/ballen How do I point a sub-domain to a sub-directory or sub-web of my site using asp.net?
I know normally domains are setup to point to the root directory of the web site. However, how can I detect which URL a person is browsing to on my site with ("such as leon.mydomain.com"), and redirect them to the appropriate place on within site ("such as mydomain.com/help/leon05"), and where do I want to put this code in default page of the website or in the global.asax file.
Thanks!
Oh, I had assumed you had proper DNS entries for your domain and subdomains.
So if it's parked, then a redirect to your specific URL would also work.
-Brock
DevelopMentor http://staff.develop.com/ballen maybe I should just do just a domain redirect form where the domain name is parked? "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message news:20*********************@msnews.microsoft.com. .. Yes, I suppose that would work. The downside is that you'd have to code this for every page, I presume? And what happens when you want to support a 3rd, 4th or 5th domain? Again, there are always two ways to skin a cat. I'd suggest seeking out the sharper knife, though ;)
-Brock DevelopMentor http://staff.develop.com/ballen something like this would work right?
<% sname = Request.ServerVariables("SERVER_NAME") sname = ucase(sname) if InStr(sname,"DOMAIN1") <> 0 then response.redirect "subdirectory to go to" elseif InStr(sname,"DOMAIN2") <> 0 then response.redirect "2nd subdirectory to go to" end if %> "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message news:17*********************@msnews.microsoft.com. .. You need to configure a new website in IIS and it can use the HTTP host header to distinguish which website to access. Then in your second website configure to map to any directory you want to.
-Brock DevelopMentor http://staff.develop.com/ballen > How do I point a sub-domain to a sub-directory or sub-web of my > site using asp.net? > > I know normally domains are setup to point to the root directory > of the web site. However, how can I detect which URL a person is > browsing to on my site with ("such as leon.mydomain.com"), and > redirect them to the appropriate place on within site ("such as > mydomain.com/help/leon05"), and where do I want to put this code > in default page of the website or in the global.asax file. > > Thanks! >
I do I do a doamin forward from where the domain is parked, but mask or is
it impossible? See example below..
Parked domain = www.mydomain .com
so I set-up a domain forward to www.maindomain .com, but I want the url to
keep showing mydomain.com.
"Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message
news:22*********************@msnews.microsoft.com. .. Oh, I had assumed you had proper DNS entries for your domain and subdomains. So if it's parked, then a redirect to your specific URL would also work.
-Brock DevelopMentor http://staff.develop.com/ballen
maybe I should just do just a domain redirect form where the domain name is parked? "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message news:20*********************@msnews.microsoft.com. .. Yes, I suppose that would work. The downside is that you'd have to code this for every page, I presume? And what happens when you want to support a 3rd, 4th or 5th domain? Again, there are always two ways to skin a cat. I'd suggest seeking out the sharper knife, though ;)
-Brock DevelopMentor http://staff.develop.com/ballen something like this would work right?
<% sname = Request.ServerVariables("SERVER_NAME") sname = ucase(sname) if InStr(sname,"DOMAIN1") <> 0 then response.redirect "subdirectory to go to" elseif InStr(sname,"DOMAIN2") <> 0 then response.redirect "2nd subdirectory to go to" end if %> "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message news:17*********************@msnews.microsoft.com. .. > You need to configure a new website in IIS and it can use the HTTP > host header to distinguish which website to access. Then in your > second website configure to map to any directory you want to. > > -Brock > DevelopMentor > http://staff.develop.com/ballen >> How do I point a sub-domain to a sub-directory or sub-web of my >> site using asp.net? >> >> I know normally domains are setup to point to the root directory >> of the web site. However, how can I detect which URL a person is >> browsing to on my site with ("such as leon.mydomain.com"), and >> redirect them to the appropriate place on within site ("such as >> mydomain.com/help/leon05"), and where do I want to put this code >> in default page of the website or in the global.asax file. >> >> Thanks! >>
Ah, but that's a security problem. The redirect is going to be your best
bet. The other hack I've seen is to make your first domain have a page that
contains a frame that points to the second domain. This sort of works, I
guess :)
-Brock
DevelopMentor http://staff.develop.com/ballen I do I do a doamin forward from where the domain is parked, but mask or is it impossible? See example below.. Parked domain = www.mydomain .com so I set-up a domain forward to www.maindomain .com, but I want the url to keep showing mydomain.com. "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message news:22*********************@msnews.microsoft.com. ..
Oh, I had assumed you had proper DNS entries for your domain and subdomains. So if it's parked, then a redirect to your specific URL would also work.
-Brock DevelopMentor http://staff.develop.com/ballen maybe I should just do just a domain redirect form where the domain name is parked? "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message news:20*********************@msnews.microsoft.com. .. Yes, I suppose that would work. The downside is that you'd have to code this for every page, I presume? And what happens when you want to support a 3rd, 4th or 5th domain? Again, there are always two ways to skin a cat. I'd suggest seeking out the sharper knife, though ;)
-Brock DevelopMentor http://staff.develop.com/ballen > something like this would work right? > > <% > sname = Request.ServerVariables("SERVER_NAME") > sname = ucase(sname) > if InStr(sname,"DOMAIN1") <> 0 then > response.redirect "subdirectory to go to" > elseif InStr(sname,"DOMAIN2") <> 0 then > response.redirect "2nd subdirectory to go to" > end if > %> > "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in > message > news:17*********************@msnews.microsoft.com. .. >> You need to configure a new website in IIS and it can use the >> HTTP host header to distinguish which website to access. Then in >> your second website configure to map to any directory you want >> to. >> >> -Brock >> DevelopMentor >> http://staff.develop.com/ballen >>> How do I point a sub-domain to a sub-directory or sub-web of my >>> site using asp.net? >>> >>> I know normally domains are setup to point to the root directory >>> of the web site. However, how can I detect which URL a person is >>> browsing to on my site with ("such as leon.mydomain.com"), and >>> redirect them to the appropriate place on within site ("such as >>> mydomain.com/help/leon05"), and where do I want to put this code >>> in default page of the website or in the global.asax file. >>> >>> Thanks! >>>
thanks so much for your time, but what do you mean by "The other hack I've
seen is to make your first domain have a page that contains a frame that
points to the second domain"?
"Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message
news:24*********************@msnews.microsoft.com. .. Ah, but that's a security problem. The redirect is going to be your best bet. The other hack I've seen is to make your first domain have a page that contains a frame that points to the second domain. This sort of works, I guess :)
-Brock DevelopMentor http://staff.develop.com/ballen I do I do a doamin forward from where the domain is parked, but mask or is it impossible? See example below.. Parked domain = www.mydomain .com so I set-up a domain forward to www.maindomain .com, but I want the url to keep showing mydomain.com. "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message news:22*********************@msnews.microsoft.com. ..
Oh, I had assumed you had proper DNS entries for your domain and subdomains. So if it's parked, then a redirect to your specific URL would also work.
-Brock DevelopMentor http://staff.develop.com/ballen maybe I should just do just a domain redirect form where the domain name is parked? "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message news:20*********************@msnews.microsoft.com. .. > Yes, I suppose that would work. The downside is that you'd have to > code this for every page, I presume? And what happens when you want > to support a 3rd, 4th or 5th domain? Again, there are always two > ways to skin a cat. I'd suggest seeking out the sharper knife, > though ;) > > -Brock > DevelopMentor > http://staff.develop.com/ballen >> something like this would work right? >> >> <% >> sname = Request.ServerVariables("SERVER_NAME") >> sname = ucase(sname) >> if InStr(sname,"DOMAIN1") <> 0 then >> response.redirect "subdirectory to go to" >> elseif InStr(sname,"DOMAIN2") <> 0 then >> response.redirect "2nd subdirectory to go to" >> end if >> %> >> "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in >> message >> news:17*********************@msnews.microsoft.com. .. >>> You need to configure a new website in IIS and it can use the >>> HTTP host header to distinguish which website to access. Then in >>> your second website configure to map to any directory you want >>> to. >>> >>> -Brock >>> DevelopMentor >>> http://staff.develop.com/ballen >>>> How do I point a sub-domain to a sub-directory or sub-web of my >>>> site using asp.net? >>>> >>>> I know normally domains are setup to point to the root directory >>>> of the web site. However, how can I detect which URL a person is >>>> browsing to on my site with ("such as leon.mydomain.com"), and >>>> redirect them to the appropriate place on within site ("such as >>>> mydomain.com/help/leon05"), and where do I want to put this code >>>> in default page of the website or in the global.asax file. >>>> >>>> Thanks! >>>>
So for the domain whose name you want to keep in the address bar, make a
default.htm that does something like this, you'll have to get all the right
attributes but this should give you the idea:
<html>
<frameset>
<frame src="http://otherdomain.com" />
</frameset>
</html>
-Brock
DevelopMentor http://staff.develop.com/ballen thanks so much for your time, but what do you mean by "The other hack I've seen is to make your first domain have a page that contains a frame that points to the second domain"? "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message news:24*********************@msnews.microsoft.com. .. Ah, but that's a security problem. The redirect is going to be your best bet. The other hack I've seen is to make your first domain have a page that contains a frame that points to the second domain. This sort of works, I guess :)
-Brock DevelopMentor http://staff.develop.com/ballen I do I do a doamin forward from where the domain is parked, but mask or is it impossible? See example below.. Parked domain = www.mydomain .com so I set-up a domain forward to www.maindomain .com, but I want the url to keep showing mydomain.com. "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message news:22*********************@msnews.microsoft.com. .. Oh, I had assumed you had proper DNS entries for your domain and subdomains. So if it's parked, then a redirect to your specific URL would also work.
-Brock DevelopMentor http://staff.develop.com/ballen > maybe I should just do just a domain redirect form where the > domain > name is > parked? > "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in > message > news:20*********************@msnews.microsoft.com. .. >> Yes, I suppose that would work. The downside is that you'd have >> to code this for every page, I presume? And what happens when you >> want to support a 3rd, 4th or 5th domain? Again, there are always >> two ways to skin a cat. I'd suggest seeking out the sharper >> knife, though ;) >> >> -Brock >> DevelopMentor >> http://staff.develop.com/ballen >>> something like this would work right? >>> >>> <% >>> sname = Request.ServerVariables("SERVER_NAME") >>> sname = ucase(sname) >>> if InStr(sname,"DOMAIN1") <> 0 then >>> response.redirect "subdirectory to go to" >>> elseif InStr(sname,"DOMAIN2") <> 0 then >>> response.redirect "2nd subdirectory to go to" >>> end if >>> %> >>> "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in >>> message >>> news:17*********************@msnews.microsoft.com. .. >>>> You need to configure a new website in IIS and it can use the >>>> HTTP host header to distinguish which website to access. Then >>>> in your second website configure to map to any directory you >>>> want to. >>>> >>>> -Brock >>>> DevelopMentor >>>> http://staff.develop.com/ballen >>>>> How do I point a sub-domain to a sub-directory or sub-web of >>>>> my site using asp.net? >>>>> >>>>> I know normally domains are setup to point to the root >>>>> directory of the web site. However, how can I detect which URL >>>>> a person is browsing to on my site with ("such as >>>>> leon.mydomain.com"), and redirect them to the appropriate >>>>> place on within site ("such as mydomain.com/help/leon05"), and >>>>> where do I want to put this code in default page of the >>>>> website or in the global.asax file. >>>>> >>>>> Thanks! >>>>>
Thanks so much allen. i think i will stick with just the redirect/domain
forwarding!!!
"Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message
news:24*********************@msnews.microsoft.com. .. So for the domain whose name you want to keep in the address bar, make a default.htm that does something like this, you'll have to get all the right attributes but this should give you the idea:
<html> <frameset> <frame src="http://otherdomain.com" /> </frameset> </html>
-Brock DevelopMentor http://staff.develop.com/ballen thanks so much for your time, but what do you mean by "The other hack I've seen is to make your first domain have a page that contains a frame that points to the second domain"? "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message news:24*********************@msnews.microsoft.com. .. Ah, but that's a security problem. The redirect is going to be your best bet. The other hack I've seen is to make your first domain have a page that contains a frame that points to the second domain. This sort of works, I guess :)
-Brock DevelopMentor http://staff.develop.com/ballen I do I do a doamin forward from where the domain is parked, but mask or is it impossible? See example below.. Parked domain = www.mydomain .com so I set-up a domain forward to www.maindomain .com, but I want the url to keep showing mydomain.com. "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in message news:22*********************@msnews.microsoft.com. .. > Oh, I had assumed you had proper DNS entries for your domain and > subdomains. So if it's parked, then a redirect to your specific URL > would also work. > > -Brock > DevelopMentor > http://staff.develop.com/ballen >> maybe I should just do just a domain redirect form where the >> domain >> name is >> parked? >> "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in >> message >> news:20*********************@msnews.microsoft.com. .. >>> Yes, I suppose that would work. The downside is that you'd have >>> to code this for every page, I presume? And what happens when you >>> want to support a 3rd, 4th or 5th domain? Again, there are always >>> two ways to skin a cat. I'd suggest seeking out the sharper >>> knife, though ;) >>> >>> -Brock >>> DevelopMentor >>> http://staff.develop.com/ballen >>>> something like this would work right? >>>> >>>> <% >>>> sname = Request.ServerVariables("SERVER_NAME") >>>> sname = ucase(sname) >>>> if InStr(sname,"DOMAIN1") <> 0 then >>>> response.redirect "subdirectory to go to" >>>> elseif InStr(sname,"DOMAIN2") <> 0 then >>>> response.redirect "2nd subdirectory to go to" >>>> end if >>>> %> >>>> "Brock Allen" <ba****@develop.com.i_hate_spam_too> wrote in >>>> message >>>> news:17*********************@msnews.microsoft.com. .. >>>>> You need to configure a new website in IIS and it can use the >>>>> HTTP host header to distinguish which website to access. Then >>>>> in your second website configure to map to any directory you >>>>> want to. >>>>> >>>>> -Brock >>>>> DevelopMentor >>>>> http://staff.develop.com/ballen >>>>>> How do I point a sub-domain to a sub-directory or sub-web of >>>>>> my site using asp.net? >>>>>> >>>>>> I know normally domains are setup to point to the root >>>>>> directory of the web site. However, how can I detect which URL >>>>>> a person is browsing to on my site with ("such as >>>>>> leon.mydomain.com"), and redirect them to the appropriate >>>>>> place on within site ("such as mydomain.com/help/leon05"), and >>>>>> where do I want to put this code in default page of the >>>>>> website or in the global.asax file. >>>>>> >>>>>> Thanks! >>>>>> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Leif Wessman |
last post by:
I need help creating a regular expression to find the subdomain in the
$HTTP_HOST variable.
The domain is always in this form:
www.domain.com
or
uk.domain.com
or
domain.com
|
by: Bobby Ray |
last post by:
Hi PHP People,
When using mail() with a TO address that includes a subdomain, as in
foo@sub.domain.com, the intended recipient never receives the mail.
I'm not sure if this is a problem with...
|
by: perspolis |
last post by:
Hi
If I want to create subdomain for my site dynamicaly how can I do that with
ASP.NET?
or is it possib;e to create subdomain with IIS??
thanks
|
by: thomas |
last post by:
Hello all,
It seems like subdomain forwarding prevents ASP.Net session state from
working correctly.
Example: two websites http://www.jgphotographers.com/test and...
|
by: anj.smart |
last post by:
Hi:-I have my own webspace www.domain.com. When any new user register
on to my site, a new url name www.subdomain.domain.com or
www.domain.subdomain.com should be provided to it.
I want to provide...
|
by: tolkienarda |
last post by:
hi all
i have a wildcard subdomain that will redirect all subdomains to one page. this page is a php script that will read the what subdomain they entered and if it is valid it will redirect to...
|
by: Greg |
last post by:
Is it possible for authentication using asp.net membership to persist
from a
site to a subdomain?
The scenario I want to provide is:
User browses to the page somesite.com and logs in.
User...
|
by: a2rodger |
last post by:
I am using the following function and parse_url() to attempt to grab the subdomain from my sites url
function selfURL() { $s = empty($_SERVER) ? '' : ($_SERVER == "on") ? "s" : ""; $protocol =...
|
by: devilsjunk |
last post by:
Hello Everybody,
In my web application I have created an interface where, if any user register then a subdomain will be created with the user name of the user link this manner
E.G. :-...
|
by: Josh |
last post by:
I have a question about subdomains. I would like my website to have
subdomains that essentially show my regular main website, except that
the subdomain passes as a variable on all pages so that I...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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...
|
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...
|
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,...
| |