[英]URL rewrite in ASP.NET application
How do I redirect url based on register client in c# .net or asp.net 4.0. 如何在c#.net或asp.net 4.0中基于注册客户端重定向url。 For example if client registers as "client1" and our website is www.mycompany.com for every page client proceeds should get www.client1.mycompany.com.
例如,如果客户注册为“ client1”,而我们的网站是www.mycompany.com,则客户收益的每一页都应获得www.client1.mycompany.com。
More detailed example: 更详细的例子:
For example another client created is Client2. 例如,创建的另一个客户端是Client2。 The pages i have created in general is like
我一般创建的页面就像
"www.mycompany.com/product.aspx"
"www.mycompany.com/categories.aspx" should be shown as
"www.client2.mycompany.com/product.aspx" and
"www.client2.mycompany.com/categories.aspx" respectively
I have searched on web and found for static pages or using Gloabal.asax during startup of application but haven't found any thing after user logged in. 我已经在网上搜索并找到了静态页面,或者在应用程序启动期间使用了Gloabal.asax,但是在用户登录后却找不到任何东西。
I have done something similar before in a few sites and there are a couple methods you could use. 我之前在一些站点中已经做过类似的事情,并且可以使用几种方法。 Assuming that you have a url setup so that all subdomains ( *.url.com) will send any user to your server and you have IIS setup to handle them all (ie no host header required, just IP) in the same site you can use one of the following methods:
假设您具有url设置,以便所有子域(* .url.com)都可以将任何用户发送到您的服务器,并且您具有IIS设置来处理它们在同一站点中的所有用户(即,不需要主机头,只需IP)使用以下方法之一:
I hope that makes since. 我希望从那以后。
There's a project called UrlRewritingNet which I use - it's pretty old but the source is available so you could recompile it for 4.0. 我使用了一个名为UrlRewritingNet的项目-它很旧,但是源可用,因此您可以将其重新编译为4.0。
Link is at http://urlrewriting.net/149/en/home.html 链接位于http://urlrewriting.net/149/en/home.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.