0

I've been looking on how to create profile links like in Facebook "www.facebook.com/profile_name"?

Anyone knows how what is the term for that or links for that tutorial in ASP .Net C#?

EDIT: What I'm trying to achieve here is to create a link for each member that could redirect to their profile page. Here is an example of the link: www.mywebsite.com/Member_Name

I'm using ASP .Net Framework 3.5

Thanks

Kiran
  • 20,167
  • 11
  • 67
  • 99
Ernie Ahsir
  • 27
  • 2
  • 7
  • Your question doesn't make sense at all. Are you talking about URLs? Like the url has a _profilename_ at the end and goes to the profile? – gideon Mar 21 '12 at 05:45
  • Sorry for that. I've been talking about the Rewrite_engine like what @Kevin have said. – Ernie Ahsir Mar 21 '12 at 06:11
  • You want to rewrite/change the urls right? I've written my answer assuming this. – gideon Mar 21 '12 at 06:29

2 Answers2

0

I think you're looking for mod_rewrite.

Search the web for apache mod_rewrite or friendly URLS to get up to speed on this topic.

http://en.wikipedia.org/wiki/Rewrite_engine

Kevin
  • 1,685
  • 7
  • 28
  • 55
0

So it seems you are talking about Url rewriting or routing.

I would suggest using Asp.net Url routing, which is supported Asp.net 3.5 SP1 onward.It's what asp.net mvc uses.

Rewriting:

See this SO answer and this article on the difference between routing and rewriting. (This is to do with IIS/aspnet)

Url Rewrite is at the IIS level, for newer versions of IIS there is a URl rewrite module. See this. For older versions of IIS there is this open source module.

Routing:

Asp.net 3.5 SP1 onward supports routing, which is at the application code level. It can do what you want, something like www.mysite.com/username instead of www.mysite.com/User.aspx?id=1234. See this article and this MSDN article for more info on this.

Community
  • 1
  • 1
gideon
  • 19,329
  • 11
  • 72
  • 113
  • I've read the whole article but still I don't know where to start on how create the codes in creating a URL for each profile page. – Ernie Ahsir Mar 21 '12 at 07:20
  • Have you see the codeproject article? And the msdn article? What version of asp.net are you using? – gideon Mar 21 '12 at 07:26
  • I've seen both the codeproject and msdn article. I've tried the msdn article and I'm stuck at the `CustomRouteHandler` of the Global.asax.cs. – Ernie Ahsir Mar 21 '12 at 09:07
  • @ErnieAhsir How exactly are you stuck? Could you also put your requirement in your question, what is the page you have and what is the url you want? (Click `edit` in your question and add it there) – gideon Mar 21 '12 at 09:10