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

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

No comments:

Post a Comment