Monday, 6 June 2016

How to Handle :: 301 Permanent Redirect

This morning my business client came with one of requirement where he wanted to redirect around 15000 old Url to new Url.

Worst thing was he wanted to get this done ASAP as it was impacting on SEO ranking heavily.

Post analysis I came to know that around 12000 Url are pointing to common url while 3000 of them  pointing as 1:1.

For common url i have Created Rewrite Rules using  URL Rewrite Module

For 3000 url fow which we had 1:1 mapping I have used Custom File Map Provider.

Happy redirecting.





More Details can be found below

http://www.iis.net/learn/extensions/url-rewrite-module/using-custom-rewrite-providers-with-url-rewrite-module





<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <providers>
        <provider name="FileMap" type="FileMapProvider, Microsoft.Web.Iis.Rewrite.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
          <settings>
            <add key="FilePath" value="{DOCUMENT_ROOT}\App_Data\redirectmappings.txt" />
            <add key="IgnoreCase" value="1" />
            <add key="Separator" value="," />
          </settings>
        </provider>
      </providers>
      <rules>
        <rule name="FileMapProviderTest" stopProcessing="true">
          <match url="(.*)" />
          <conditions>
            <add input="{FileMap:{R:1}}" pattern="(.+)" />
          </conditions>
          <action type="Redirect" url="{C:1}" />
        </rule>
      </rules>
    </rewrite>

No comments:

Post a Comment

Featured post

Getting Started With SOLR

Getting Started with Solr ·           Features o    Hit highlighting o    Auto correction o    Faceted Search o    Multi lan...