3

I used to build my web apps in asp.net in such there is only one page witch is default.aspx

http://localhost/mywebapp1/?q=blog/posts/get/42

I do parse 'q' by myself and do all processing. I don't really need to all MVC staff. I just want to remove "?q="

any idea?

2 Answers 2

3

You can use ASP.NET Routing outside of ASP.NET MVC. This MSDN article explains how.

Sign up to request clarification or add additional context in comments.

Comments

1

If you're using IIS 7 (Windows 2008 / Vista or higher) you could use the IIS URL Rewrite module from http://www.iis.net/download/URLRewrite

You define the rules either in web.config or through the IIS front end.

For example I use the following for friendly URLS to shop items on my site.

It makes mysite.com/shop/package-one to to mysite.com/shop/default.aspx?package=package-one

<rewrite>
  <rules>
    <rule name="ShopPackages" stopProcessing="true">
      <match url="^shop/(.*)"/>
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
      </conditions>
      <action type="Rewrite" url="/shop/default.aspx?package={R:1}" appendQueryString="false"/>
    </rule>
  </rules>
</rewrite> 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.