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?

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

IIS 7.0 rewrite module documentation


Also IIS redirects http://knowledge.freshpromo.ca/seo-tools/301-redirect.php#aspnet

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

<?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="http://www.example.com/Default.aspx#&&{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" />

mod_rewrite: http://www.phatz.com/301redirect.php

  • Wat? Why the downvote? – HaloWebMaster Jun 21 '12 at 15:51
  • 3
    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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy