vendredi 30 janvier 2015

How do I rewrite the domain in Sharepoint 2010 when "www" is missing in the request path?



I need http://ift.tt/1HtCh3y to be redirected to http://ift.tt/1yNowCc (adding the "www"). For some reason it always redirects to http://ift.tt/1HtChjZ. I have the following rewrite rule in my web.config:



<rule name="Vanity URL" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="example.com" />
<add input="{URL}" pattern="^photogallery$" />
</conditions>
<action type="Redirect" url="http://ift.tt/1yNowCc" appendQueryString="false" redirectType="Found" />
</rule>


I've also tried putting the URL match outside of the conditions:



<rule name="Vanity URL" stopProcessing="true">
<match url="^photogallery$" />
<conditions>
<add input="{HTTP_HOST}" pattern="example.com" />
</conditions>
<action type="Redirect" url="http://ift.tt/1yNowCc" appendQueryString="false" redirectType="Found" />
</rule>


I've also tried a million permutations of regexes, but I feel like there is some default Sharepoint routing to the main default.aspx page that is overriding all of my efforts. Can anyone help?








0 commentaires:

Enregistrer un commentaire