Friday, April 27, 2012

Fix 5 Common SEO problems using URLRewrite module and Web.config

There are an example code used to fix top 5 common problems for SEO, to get unique urls, improve ranking on Search Engine likes Google, Bing, Yaoo

This example is run on example.com

<rewrite>
                <rules>
                    <!--Fix 5 Common SEO problems using URLRewrite module and Web.config-->
                    <rule name="No-slash to slash">
                        <match url="http://example.com"/>
                        <action type="Redirect" url="http://example.com/" redirectType="Permanent"/>
                    </rule>
                    <rule name="www to non-www">
                        <match url="(.*)"/>
                        <conditions>
                            <add input="{HTTP_HOST}" pattern="^example\.com$" negate="true"/>
                        </conditions>
                        <action type="Redirect" url="http://example.com/{R:1}" redirectType="Permanent"/>
                    </rule>
                    <rule name="No Default.aspx" stopProcessing="true">
                        <match url="(.*?)/?Default\.aspx$"/>
                        <action type="Redirect" url="{R:1}/" redirectType="Permanent"/>
                    </rule>
                    <rule name="No .aspx" stopProcessing="true">
                        <match url="(.*?)\.aspx$"/>
                        <action type="Redirect" url="{R:1}.html" redirectType="Permanent"/>
                    </rule>
                    <rule name="Lower Case URLs" stopProcessing="true">
                        <match url="[A-Z]" ignoreCase="false"/>
                        <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                            <add input="{URL}" pattern="WebResource.axd" negate="true"/>
                        </conditions>
                        <action type="Redirect" url="{ToLower:{URL}}" redirectType="Permanent"/>
                    </rule>

                    <!--End Fix 5 Common SEO problems using URLRewrite module and Web.config-->
                </rules>
            </rewrite>

Place at between:
<system.webserver>
....
</system.webserver>


Lai

3 comments:

  1. I Will Provide Seo Blog Comment Service. & niche relevant blog comment service we provide a quality service with 100% Buyer satisfaction and My team Believed in Quality work not Quantity Contact me Now 24/7.

    ReplyDelete