Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i know that it can be done with MVC, but can it be done with the ordinary ASP.Net website
i want for example "www.stackoverflow.com/questions/ask?title=some thing........"
to be like "www.stackoverflow.com/questions/whatever" just to make it nice and easy to read.
i don't want to edit any rule in IIS, i want to do it in C# code.
any help is appreciated.
Posted

1 solution

Hi Prutal,

I think you can find your answer here[^] and here[^].
Hope this helps you a bit.

Regards,
RK
 
Share this answer
 
Comments
Prutal 3-Dec-13 3:50am    
after the whole day reading and searching, i reach to a conclusion that:
the concept of url rewriting is to route the url or to rewrite the url in the request to the real page.

example:
<pre> <a href="http://www.example.com/something"></a></pre>

when this link is clicked the Application_BeginRequest in the global.asax will handle the Request.URL and rewrite it to "http://www.example.com/something_else.aspx" or any other real page in the site that have a meaning to the server to render it, also the url could contain a query string parameters, so they should be included in both real url and virtual url(example
virtual: "http://www.example.com/something/12"
real: "http://www.example.com/something_else.aspx?"

).

will this is cool, but in my case the scenario is that, i have all the site running, if i want to change all the links in the site will be a very tedious work.

any suggestion
♥…ЯҠ…♥ 3-Dec-13 5:02am    
I think you can read this http://www.iis.net/learn/extensions/url-rewrite-module/iis-url-rewriting-and-aspnet-routing to rewrite the url to whole application.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900