Question

I'am using intelligencia.UrlRewriter on my web site.

I'am sending two querystring parameter to profil page.

 <asp:HyperLink ID="lnkProfil" runat="server"   Text='profil' NavigateUrl='/u/9f51e845-1089-4495-bd66-964db5b9c47b/tiju' ForeColor="Silver"></asp:HyperLink>

web config :

<rewrite url="~/u/(.+)/(.+)" to="~/Profil.aspx?user_id=$1&amp;user_name=$2" />

and url seems like

http://yxyx.com/u/9f51e845-1089-4495-bd66-964db5b9c47b/tiju

But I want to make like

http://yxyx.com/u/tiju or directly http://yxyx.com/tiju (like facebook & twitter)

How can I hide user id parameter on url ?

Was it helpful?

Solution

If you want to have http://yxyx.com/u/tiju you should set it in the HyperLink

<asp:HyperLink ... NavigateUrl='/u/tiju' ...

In this case rewrite rule could be as

<rewrite url="~/u/(.+)" to="~/Profil.aspx?user_name=$1" />

As you see, in this case you will send only one parameter (tiju)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top