如何实现漂亮的用户界面URL,例如Facebook或Twitter? [英] How to achieve nice litle USER page url like facebook or twitter?

查看:123
本文介绍了如何实现漂亮的用户界面URL,例如Facebook或Twitter?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.NET应用程序,允许用户创建他们的帐户。

I have a .NET app and I let users to create their account.

现在,用户页面看起来像http:/// user /?user =大师

Right now the user page looks like http:///user/?user=guru

我在应用程序根目录下有一个用户子文件夹,这是用户页面的aspx页面所在的地方

I have a user subfolder at the app root and that is where the aspx pages for user page are

如何让我的用户访问其Twitter,Facebook或youtube等页面?

How can I let my users access their pages like twitter, facebook or youtube?

他们的用户个人资料\频道\帐户具有以下格式: http://www.facebook.com/guru

Their user profile\channel\account has this format: http://www.facebook.com/guru

此网址简短易记和共享的方式

This way the URL is short and easy to remember and share

谢谢

推荐答案

这称为 URL重写。您有一些代码可以使用原始的 facebook.com/guruURL,然后在托管应用程序尝试对其进行处理之前将其转换为 facebook.com/?user=guruURL。

This is called "url rewriting". You have some code that takes the original "facebook.com/guru" URL and coverts it into the "facebook.com/?user=guru" URL before the hosting application tries to process it.

取决于您的Web服务器,可能已经构建了一个模块,您可以执行此操作。在IIS中,您可以使用自定义HttpModule或 URL重写模块

Depending on your web server, there is probably a module already built that lets you do this. In IIS, you can either use a custom HttpModule or the URL rewriting module.

这篇关于如何实现漂亮的用户界面URL,例如Facebook或Twitter?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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