Simple URL ReWriting/Mapping in IIS7

There’s an easy alternative to other over-complicated solutions on the web if your mappings are simple/static and/or you have a spare grunt to quickly and easily keep them updated without having to write a line of code.

In web.config add:

    <modules runAllManagedModulesForAllRequests="true" />

Under system.web add static mappings like so:

<urlMappings enabled="true">
			<add url="~/default" mappedUrl="index.aspx"/>
			<add url="~/login" mappedUrl="login.aspx"/>
			<add url="~/logout" mappedUrl="logout.aspx"/>


Of course some scenarios require more complex mappings, but for most non-ecomm/non-web app sites and even blogs this solution would work np, be faster to maintain without requiring assembly publishes and is less error-prone.


About Ronnie Diaz

Ronnie Diaz is a software engineer and tech consultant. Ronnie started his career in front-end and back-end development for companies in ecommerce, service industries and remote education. This work transitioned from traditional desktop client-server applications through early cloud development. Software included human resource management and service technician workflows, online retail e-commerce and electronic ordering and fulfillment, IVR customer relational systems, and video streaming remote learning SCORM web applications. Hands on server experience and software performance optimization led to creation of a startup business focused on collocated data center services and continued experience with video streaming hardware and software. This led to a career in Amazon Prime Video where Ronnie is currently employed, building software and systems which stream live sports and events for millions of viewers around the world.

Posted on April 6, 2011, in Programming & Development and tagged , , , . Bookmark the permalink. 1 Comment.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: