iis7 redirect (301)

Topics: ASP.NET 2.0
Feb 8, 2010 at 8:06 PM


I am trying to redirect all of my blogengine like urls to my wordpress blog but struggling to accomplish this task.  Please help!

blogengine url format: http://www.mydomain.com/post/2010/02/07/this-is-the-post-title.aspx

wordpress url: http://www.mydomain.com/2010/02/07/this-is-the-post-title/

I've added a new rule along with the wordpress rule for some reason i am getting the old 404 error when I try the blogengine url format.

The site is hosted on ISS7 and PHP5 (godaddy windows shared hosting)

please have a look at my web.config and let me know if i am doing anything wrong:

<configuration>
  <system.webServer>
    <rewrite>
    
    <rules>
        <rule name="Redirect(301) all BlogEngine posts">
            <match url="(/20[0-9][0-9]/\d{2}/\d{2}/)(.*).aspx" />
            <action type="Rewrite" url="{R:0}{R:1}/" />
        </rule>    
    
        <rule name="wordpress" patternSyntax="Wildcard">
         <match url="*" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            </conditions>
          <action type="Rewrite" url="index.php" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>


Please Note: the wordpress rewrite  rule works fine.