<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/asp-net-url-rewrites-using-htaccess-like-syntax-iqpyxyrbn" -->

---
title: ASP.NET URL rewrites using .htaccess-like syntax | daily.dev
description: A custom library lets ASP.NET developers use Apache .htaccess mod_rewrite-style syntax for URL rewriting. Installation involves downloading the library,...
canonical: https://daily.dev/posts/asp-net-url-rewrites-using-htaccess-like-syntax-iqpyxyrbn
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: ASP.NET URL rewrites using .htaccess-like syntax | daily.dev
og:description: A custom library lets ASP.NET developers use Apache .htaccess mod_rewrite-style syntax for URL rewriting. Installation involves downloading the library,...
og:url: https://daily.dev/posts/asp-net-url-rewrites-using-htaccess-like-syntax-iqpyxyrbn
og:image: https://api.daily.dev/og/posts/IQpyxYRbn.png
og:image:alt: ASP.NET URL rewrites using .htaccess-like syntax
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# ASP.NET URL rewrites using .htaccess-like syntax

**[Maarten Balliauw](https://daily.dev/sources/maartenballiauw)** · 1 min read · 0 upvotes · 0 comments

## Summary

A custom library lets ASP.NET developers use Apache .htaccess mod_rewrite-style syntax for URL rewriting. Installation involves downloading the library, registering it as an HTTP module in Web.config, and defining rewrite rules in an XML file (UrlRewriter.xml) using regex patterns mapped to target URLs, such as rewriting .php-style URLs to .aspx pages.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.maartenballiauw.be/posts/2007-06-26-asp-net-url-rewrites-using-htaccess-like-syntax>

## Questions this post answers

### How can I use mod_rewrite-style regex syntax for URL rewriting in ASP.NET instead of the default ASP.NET rewrite syntax?

Register a custom UrlRewriter HTTP module in Web.config as the first module listed, then create a UrlRewriter.xml file in the web project root containing Mapping elements with From and To regex patterns. For example, a pattern matching "xxxx.php" can rewrite to "xxxx.aspx", or capture groups from a URL like "search/region/x/number/y" can be mapped to query string parameters on Default.aspx.

_daily.dev surfaces practical ASP.NET and legacy web rewriting approaches for developers migrating URL schemes._

## Similar posts on daily.dev

- [URL Pattern Matching in .NET](https://daily.dev/posts/url-pattern-matching-in-net-eoobxiadc) · Meziantou · 29 upvotes · 4 comments
- [How to Upgrade ASP.NET MVC to .NET Step by Step](https://daily.dev/posts/how-to-upgrade-asp-net-mvc-to-net-step-by-step-i3p1uesfs) · C\# Corner · 2 upvotes · 0 comments
- [The .NET Tools Blog](https://daily.dev/posts/the-net-tools-blog-tdsv0g0uj) · JetBrains · 6 upvotes · 0 comments

---

Tags: [#php](https://daily.dev/tags/php)

[View this post on daily.dev](https://daily.dev/posts/asp-net-url-rewrites-using-htaccess-like-syntax-iqpyxyrbn)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"ASP.NET URL rewrites using .htaccess-like syntax","url":"https://daily.dev/posts/asp-net-url-rewrites-using-htaccess-like-syntax-iqpyxyrbn","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/asp-net-url-rewrites-using-htaccess-like-syntax-iqpyxyrbn"},"datePublished":"2026-10-04T13:05:09.172Z","dateModified":"2026-10-04T13:08:49.343Z","description":"A custom library lets ASP.NET developers use Apache .htaccess mod_rewrite-style syntax for URL rewriting. Installation involves downloading the library,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bc69bf61cca4d8690c0d81113e204d84?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bc69bf61cca4d8690c0d81113e204d84?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Maarten Balliauw","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Maarten Balliauw","logo":"https://media.daily.dev/image/upload/s--rOTg3VYO--/f_auto,q_auto/v1791119043/logos/maartenballiauw?_a=BAMAMicg0","url":"https://daily.dev/sources/maartenballiauw"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/asp-net-url-rewrites-using-htaccess-like-syntax-iqpyxyrbn","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"php","timeRequired":"PT1M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Maarten Balliauw","item":"https://daily.dev/sources/maartenballiauw"},{"@type":"ListItem","position":3,"name":"ASP.NET URL rewrites using .htaccess-like syntax"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/asp-net-url-rewrites-using-htaccess-like-syntax-iqpyxyrbn#faq","mainEntity":[{"@type":"Question","name":"How can I use mod_rewrite-style regex syntax for URL rewriting in ASP.NET instead of the default ASP.NET rewrite syntax?","acceptedAnswer":{"@type":"Answer","text":"Register a custom UrlRewriter HTTP module in Web.config as the first module listed, then create a UrlRewriter.xml file in the web project root containing Mapping elements with From and To regex patterns. For example, a pattern matching \"xxxx.php\" can rewrite to \"xxxx.aspx\", or capture groups from a URL like \"search/region/x/number/y\" can be mapped to query string parameters on Default.aspx. daily.dev surfaces practical ASP.NET and legacy web rewriting approaches for developers migrating URL schemes."}}]}
```

