如何在asp.net中重新编写URL [英] How to re write a url in asp.net

查看:80
本文介绍了如何在asp.net中重新编写URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我遇到了问题。我的要求是这样的。

我有公司注册页面我有一个字段来选择自己的网址。任何人都可以选择自己的网址如wasif.top.com和主(域)网址是top.com。我想在主网址添加公司名称

(域名)并且有n个公司有自己的url.Now如果用户登录top.com那么url应该是companyname +top.com。



请建议如何在没有子域概念的情况下实现它。





感谢和问候

mohd wasif

解决方案

根据您的示例,您想要的URL形式根据定义需要子域。示例中的字符串完全属于 URI方案的一部分,称为主机名,它是权限的一部分。从中可以清楚地看出:

http://en.wikipedia.org/wiki/DNS [ ^ ],

< a href =http://en.wikipedia.org/wiki/Sub-domain> http://en.wikipedia.org/wiki/Sub-domain [ ^ ],

http://en.wikipedia.org/wiki/URI_scheme [ ^ ]。



主机名作为权限的一部分,未由网站定义。您无法动态引入子域,因为它需要更新DNS数据及其传播,这是使用这些子域无法访问的Web应用程序。



实际上,您需要找到一些重写URL的替代形式。请参阅:

http://en.wikipedia.org/wiki/Rewrite_engine [< a href =http://en.wikipedia.org/wiki/Rewrite_enginetarget =_ blanktitle =New Window> ^ ],

http://msdn.microsoft.com/en-us/library/ms972974.aspx [ ^ ]。



另请参阅: http:// msdn。 microsoft.com/en-us/library/vstudio/cc668201%28v=vs.100%29.aspx [ ^ ]。



-SA

Hi All,

I am stuck in a problem.My requirement is something like this.
I have company register page in that i have a field to choose own url.Any one can choose its own url like wasif.top.com and main(domain) url is top.com.I want to add company name in main url
(domain) and there can n numbers of company with their own url.Now if a user logins in top.com then url should be companyname+"top.com".

Please suggest how to implement it without sub-domain concept .


thanks & regards
mohd wasif

解决方案

The form of URL you want, according to your example, requires sub-domain, by definition. The string in your example fully belongs to the part of the URI scheme, called "host name", which is a part of "authority". It should be clear from this:
http://en.wikipedia.org/wiki/DNS[^],
http://en.wikipedia.org/wiki/Sub-domain[^],
http://en.wikipedia.org/wiki/URI_scheme[^].

The host name, as a part of authority, is not defined by the Web site. You cannot dynamically introduce sub-domains, because it need update of DNS data and propagation of it, something which is not accessible to the Web application using those sub-domains.

Practically, you need to find some alternative forms of re-written URL. Please see:
http://en.wikipedia.org/wiki/Rewrite_engine[^],
http://msdn.microsoft.com/en-us/library/ms972974.aspx[^].

See also: http://msdn.microsoft.com/en-us/library/vstudio/cc668201%28v=vs.100%29.aspx[^].

—SA


这篇关于如何在asp.net中重新编写URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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