将子域指向子目录? [英] Point a subdomain to a sub-directory?

查看:93
本文介绍了将子域指向子目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用

asp.net将子域指向我网站的子目录或子网?


我知道通常域设置为指向Web的根目录

站点。但是,我如何检测一个人在我的网站上浏览的URL

with(leon.mydomain.com),并将它们重定向到相应的

放在网站内(例如mydomain.com/help/leon05"),以及我在哪里
想要将此代码放在网站的默认页面或global.asax中

文件。


谢谢!

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!

推荐答案

Request.ServerVariables会有所帮助你要确定用户的请求。

(URL,文件,路径,物理位置等)。


HTH

问候,

Jignesh Desai
www.dotnetjini.com

" Leon" < VN ***** @ msn.com>在消息中写道

news:uF ************** @ TK2MSFTNGP09.phx.gbl ...
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...
我如何指出一个使用
asp.net子域到子站点或子站点的子域名?

我知道域通常设置为指向
的根目录网站。但是,如何使用(例如leon.mydomain.com)在我的
网站上检测某个人正在浏览的网址,并将其重定向到网站内相应的
位置(" ;例如mydomain.com/help/leon05"),以及我希望将此代码放在网站的默认页面或global.asax
文件中。

谢谢!
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!



您需要在IIS中配置一个新网站,它可以使用HTTP主机头

来区分访问哪个网站。然后在你的第二个网站配置

映射到你想要的任何目录。


-Brock

DevelopMentor
http://staff.develop.com/ballen
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
如何使用asp.net将子域指向我网站的子目录或子网?

我知道通常域设置为指向到网站的根目录。但是,如何通过(例如leon.mydomain.com)检测一个人在我的网站上浏览的URL,并将其重定向到网站内的相应位置(" ;例如
mydomain.com/help/leon05"),以及我希望将此代码放在网站的默认页面或global.asax文件中。

谢谢!
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!






这样的东西可行吗?


<%

sname = Request.ServerVariables(" SERVER_NAME")

sname = ucase(sname)

if InStr(sname," DOMAIN1") <> 0然后

response.redirect"子目录转到"

elseif InStr(sname," DOMAIN2")<> 0然后

response.redirect"第二个子目录转到'

结束如果

%>

Brock Allen < BA **** @ develop.com.i_hate_spam_too>在消息中写道

news:17 ********************* @ msnews.microsoft.com。 ..
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. ..
您需要在IIS中配置一个新网站,它可以使用HTTP主机
标头来区分要访问的网站。然后在你的第二个网站上配置映射到你想要的任何目录。

-Brock
DevelopMentor
http://staff.develop.com/ballen
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
我如何指出一个子域名到我的网站的子目录或子网站
使用asp.net?

我知道通常域名设置为指向网站的根目录。但是,如何通过(例如leon.mydomain.com)检测一个人在我的网站上浏览的URL,并将其重定向到网站内的相应位置(" ;例如
mydomain.com/help/leon05"),以及我希望将此代码放在网站的默认页面或global.asax文件中。

谢谢!
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!




这篇关于将子域指向子目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆