Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 have Apache 2.2, and it's got modaspdotnet installed - the 2.2 version.

I followed the advice at Configuring ASP.NET MVC2 on Apache 2.2 using mod_aspdotnet, and the server works basically very well.

However, I'm trying to create custom extensions (e.g. file.customname, instead of file.aspx), similar to how Apache/PHP/htaccess can handle this. (I think it's mod_rewrite or .htaccess, forgotten which now!)

What would I do to get these custom file types (all serving .NET files) working?

The extensions are given custom names by me, simply for testing purposes

This is a tourism site [a testing one, btw], and it's working OK on localhost for basic pages, but I wanted to know how to do this.

How would I go about this? I've had a look on Google etc. but custom HTTP handlers was all I could really find!


share|improve this question

Rather than trying to configure handlers for this, why not just use a rewrite. In your web.config add the following to your <system.webServer> section:

          <rule name="Rewrite custom ext" stopProcessing="true">
              <match url="^(.*)\.customname$" />
              <action type="Rewrite" url="{R:1}.aspx" />

This will rewrite: ->

If you're trying to use custom extensions in an ASP.NET MVC application then you could use a route:

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.