Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to drop the .aspx extension from my webpages. One reason is that I'm not sure I will stick to ASP.NET WebForms technology. How do you do it?

share|improve this question
up vote 3 down vote accepted

Inbound URLs are easy - simply grab a tool like URL Rewriter, create a rule to map incoming requests that do not have .aspx to include the aspx in the processing of the request and you are done.

The problem, however, is outbound URLs. Your site/app generates URLs everywhere and every one of those contains a link to something.aspx and which is the very format you are trying to get away from. You can either rewrite your entire app to not include the .aspx or you can put something in the pipeline to filter those out of the pages before they are sent to the user.

Again, URL Rewriter can do this, but it takes a while to get the rules right. Another fairly common approach is to simply write your own httpModule and do the processing yourself.

Bear in mind that any utility that rewrites outbound page content may cause problems with server-side caching.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.