<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Jie Li's GeekWorld : IIS7</title><link>http://blogs.msdn.com/opal/archive/tags/IIS7/default.aspx</link><description>Tags: IIS7</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>“Fix” SharePoint 302 redirect problem by IIS7 and URL Rewrite</title><link>http://blogs.msdn.com/opal/archive/2009/06/30/fix-sharepoint-302-redirect-problem-by-iis7-and-url-rewrite.aspx</link><pubDate>Tue, 30 Jun 2009 23:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809992</guid><dc:creator>Jie Li</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/opal/comments/9809992.aspx</comments><wfw:commentRss>http://blogs.msdn.com/opal/commentrss.aspx?PostID=9809992</wfw:commentRss><description>&lt;P&gt;Recently in my spare time I’m helping my friends to get their internet facing sharepoint site up and running. Since this is for the internet, the first thing they need to consider is SEO. So we have a well known problem now: SharePoint use 302 temp redirect instead of 301. If you do a search for “sharepoint 302” you will see a lot of articles talking about the problem. &lt;/P&gt;
&lt;P&gt;Here’s the default SharePoint Site. The request was temporarily redirected (302) to Pages/default.aspx. Search engine bots don’t like it, they like 301. So this is BAD.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/opal/WindowsLiveWriter/FixSharePoint302redirectproblembyIIS7and_B6D7/snap006_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/opal/WindowsLiveWriter/FixSharePoint302redirectproblembyIIS7and_B6D7/snap006_2.jpg"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=snap006 border=0 alt=snap006 src="http://blogs.msdn.com/blogfiles/opal/WindowsLiveWriter/FixSharePoint302redirectproblembyIIS7and_B6D7/snap006_thumb.jpg" width=472 height=484 mce_src="http://blogs.msdn.com/blogfiles/opal/WindowsLiveWriter/FixSharePoint302redirectproblembyIIS7and_B6D7/snap006_thumb.jpg"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to solve it? Oh, I’m a IT Pro person, I don’t want to deal with a custom redirect HttpModule – god knows what will happen if those custom code mess up my sites! So any other options?&lt;/P&gt;
&lt;P&gt;I’m lucky because I installed SharePoint on Windows Server 2008, so I can use IIS7 features. I downloaded URL Rewrite module from &lt;A title=http://www.iis.net/extensions/URLRewrite href="http://www.iis.net/extensions/URLRewrite" mce_href="http://www.iis.net/extensions/URLRewrite"&gt;http://www.iis.net/extensions/URLRewrite&lt;/A&gt;, installed it, and started to configure the redirect.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/opal/WindowsLiveWriter/FixSharePoint302redirectproblembyIIS7and_B6D7/snap007_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/opal/WindowsLiveWriter/FixSharePoint302redirectproblembyIIS7and_B6D7/snap007_2.jpg"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=snap007 border=0 alt=snap007 src="http://blogs.msdn.com/blogfiles/opal/WindowsLiveWriter/FixSharePoint302redirectproblembyIIS7and_B6D7/snap007_thumb.jpg" width=485 height=523 mce_src="http://blogs.msdn.com/blogfiles/opal/WindowsLiveWriter/FixSharePoint302redirectproblembyIIS7and_B6D7/snap007_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Choose your site in IIS Manager, click URL Rewrite, and create a new blank rule.&lt;/P&gt;
&lt;P&gt;Use Regular Expressions to match ^$ (which means “empty”). Set Action Type to Redirect, and add the redirect URL (by default should be Pages/default.aspx), set redirect type to Permanent (301). You are all set!&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/opal/WindowsLiveWriter/FixSharePoint302redirectproblembyIIS7and_B6D7/snap005_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/opal/WindowsLiveWriter/FixSharePoint302redirectproblembyIIS7and_B6D7/snap005_2.jpg"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=snap005 border=0 alt=snap005 src="http://blogs.msdn.com/blogfiles/opal/WindowsLiveWriter/FixSharePoint302redirectproblembyIIS7and_B6D7/snap005_thumb.jpg" width=432 height=484 mce_src="http://blogs.msdn.com/blogfiles/opal/WindowsLiveWriter/FixSharePoint302redirectproblembyIIS7and_B6D7/snap005_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, clear browser cache and revisit the site:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/opal/WindowsLiveWriter/FixSharePoint302redirectproblembyIIS7and_B6D7/snap004_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/opal/WindowsLiveWriter/FixSharePoint302redirectproblembyIIS7and_B6D7/snap004_2.jpg"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=snap004 border=0 alt=snap004 src="http://blogs.msdn.com/blogfiles/opal/WindowsLiveWriter/FixSharePoint302redirectproblembyIIS7and_B6D7/snap004_thumb.jpg" width=472 height=484 mce_src="http://blogs.msdn.com/blogfiles/opal/WindowsLiveWriter/FixSharePoint302redirectproblembyIIS7and_B6D7/snap004_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;It is 301 now! Pretty easy, isn’t it?&lt;/P&gt;
&lt;P&gt;URL Rewrite module is great. If you are a regex guru you can also create more complex rules to make everything fit for your site.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9809992" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/opal/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/opal/archive/tags/Issues/default.aspx">Issues</category><category domain="http://blogs.msdn.com/opal/archive/tags/IIS7/default.aspx">IIS7</category><category domain="http://blogs.msdn.com/opal/archive/tags/Rewrite/default.aspx">Rewrite</category><category domain="http://blogs.msdn.com/opal/archive/tags/Redirect/default.aspx">Redirect</category><category domain="http://blogs.msdn.com/opal/archive/tags/SEO/default.aspx">SEO</category></item></channel></rss>