子在ASP.NET重写? [英] subdomain rewriting in ASP.NET?

查看:96
本文介绍了子在ASP.NET重写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要如何做到这一点的.NET? http://why.does.my.head.asplode.net/ 我想做这样的事情ytmnd 每个网址是一个不同的用户生成的页面。我可能需要为指向一个目录作为简单的东西,以便dirname.mysite.com会重定向到http_public / userGenContent /目录名/

How do i do this in .NET? http://why.does.my.head.asplode.net/ I want to do something like ytmnd where each url is a different user generated page. I might need something as simple as pointing to a directory so dirname.mysite.com will redirect to http_public/userGenContent/dirname/

推荐答案

哈哈...

我在处理对global.aspx这个开始请求事件,因为我的网址来自SQL Server的。

I handled the Begin request event in global.aspx for this because my urls come from sql server.

为什么这么多人子域疯了,这些天?

Why are so many people sub domain crazy these days?

在开始申请,你可以做这样的事情(不usre正是因为我是不是在我的面前得到它现在)...

in Begin Request you can do something like this (not usre exactly because I aint got it in front of me right now) ...

request.rewriteurl( "new url" );

...这将采取一切源URL是和重定向没有一个重定向到URL的响应可以在内部使用。

... this will take whatever the source url is and "redirect" without a redirect the response to a url you can use internally.

这篇关于子在ASP.NET重写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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