Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have created an ASP.NET site to replace a WordPress site that creates permalinks in the format:

I would like these URLs redirected to:

...which is what the ScriptManager generates at runtime.

The WordPress site was around for about 2 years so there are lots of bookmarks and references to these "permalinks" on the search engines etc.

Are there any modules I have to include in my website to get this to work? Is there any configuration that I have to ask my hosting company to make so that this works?

share|improve this question

migrated from Jun 23 '12 at 9:15

This question came from our site for professional and enthusiast programmers.

Are you using Webforms or MVC? – Dave Jul 23 '12 at 11:38

3 Answers 3

IIS 7.0 rewrite module documentation

Also IIS redirects

IIS does not support .htaccess so creating many re-written URL's takes a little more manual work.

share|improve this answer
<?xml version="1.0" encoding="UTF-8"?>
        <rule name="Enforce canonical hostname" stopProcessing="true">
            <match url="(.*)" />
                <add input="{HTTP_HOST}" negate="true" pattern="^www\.example\.com$" />
            <action type="Redirect" url="{R:1}" redirectType="Permanent" />
        <rule name="Remove .asp extension" stopProcessing="true">
            <match url="(.*)" />
                <add matchType="IsFile" negate="true" />
                <add matchType="IsDirectory" negate="true" />                  
            <action type="Rewrite" url="{R:1}.asp" />
share|improve this answer


share|improve this answer
Wat? Why the downvote? – HaloWebMaster Jun 21 '12 at 15:51
Because your answer is wrong. You can't use mod_rewrite on IIS and the method in the link you gave is very out of date and a time consuming way of doing it. – mattmanser Jun 21 '12 at 16:19
When someone mentions ASP.NET and hosting it's a safe assumption they're hosting on an IIS not a Linux box. – Anagio Jun 24 '12 at 7:54

Your Answer


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