开发者

How to achieve nice litle USER page url like facebook or twitter?

开发者 https://www.devze.com 2023-01-12 02:30 出处:网络
I have a .NET app and I let users to create their account. Right now the user page looks like http:///user/?user=guru

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

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

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

How can I let my users access their pages like 开发者_开发问答twitter, facebook or youtube?

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

Thanks


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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消