locked
Migration and URLRewrite RRS feed

  • Question

  • We are doing an incremental migration, site by site.

    My question is, can we rewrite/redirect a specific website to it's new location and what exactly would be the pattern

    http://sp2007.com/Teams/mymovingsite/...

    to 

    https://sp2013.mycompany.com/IT/mymovingsite/...

    but not map if ends in "?migrated" so we can access if needed

    Monday, March 9, 2015 9:25 PM

Answers

  • actually, I found the solution and it's a bit different than I expected (there may be an easier way).

    In IIS > Right click on Server Listing (not site, though you probably could)

    Match the pattern - Regular expression

    Pattern: (.*)

    Match All Condition:

    {URL} matches pattern /test(/.*)

    {query_string} does not match migrationaccess=true

    Check: Track capture Groups Accross Conditions (This is important!)

    Action: Redirect

    http://sp2013.mydomain.com/test{C:1}


    Tuesday, March 10, 2015 8:24 PM

All replies

  • Yes, you can do it.
    Tuesday, March 10, 2015 7:26 AM
  • Hi,

    Please understand that:

    Rewriting is actually changing both incoming and/or outgoing URLs. Any implementation of such rewrites is unsupported with SharePoint unless the path is symmetrical.

    Example Scenarios (All scenarios below use ARR as the proxy and use URL Rewrite to modify the URL)

      This scenario is SUPPORTED. NOTE: Hostname, port number, protocol changes are all supported in Symmetrical Rewrites

    You can refer more information in original article via http://support.microsoft.com/kb/2818415

    Regards,


    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Tuesday, March 10, 2015 9:12 AM
  • ok, so what would the pattern be in this case? I cannot seem to get this to work properly.

    I had thought using 

    http://sp2007.mydomain.com/teams/myweb/*

    would give me a Back Reference, but I do not see one, just the original match "http://sp2007.mydomain.com/"

    Tuesday, March 10, 2015 12:39 PM
  • I am not rewriting really, I am redirecting from our 2007 farm to our 2013 farm.

    This is just to capture traffic to the site on our old farm and get them to the new.

    Tuesday, March 10, 2015 12:40 PM
  • actually looks like this is a start:

    Pattern: http://sp2007.mydomain.com/teams/myweb/(.*)

    Action: redirect

    Redirect url: https://sp2013.mydomain.com/it/myweb/{R:1}

    and I can add a condition

    {Query_String} Does Not Match the Pattern migrationaccess=true

    The code looks something like this in applicationhost.config

    <rule name="SP Help" stopProcessing="true">
                        <match url="http://sp.2007mydomain.com/help/(.*)" />
                        <conditions>
                            <add input="{QUERY_STRING}" pattern="migrationaccess=true" negate="true" />
                        </conditions>
                        <action type="Redirect" url="https://sp2013.mydomain.com/help/{R:1}" />
                    </rule>

    Tuesday, March 10, 2015 2:58 PM
  • actually, I found the solution and it's a bit different than I expected (there may be an easier way).

    In IIS > Right click on Server Listing (not site, though you probably could)

    Match the pattern - Regular expression

    Pattern: (.*)

    Match All Condition:

    {URL} matches pattern /test(/.*)

    {query_string} does not match migrationaccess=true

    Check: Track capture Groups Accross Conditions (This is important!)

    Action: Redirect

    http://sp2013.mydomain.com/test{C:1}


    Tuesday, March 10, 2015 8:24 PM
  • I can only seem to get this working for the first rule. All subsequent rules redirect all requests to that site's home page. Anyone else run into this?
    Wednesday, August 28, 2019 8:31 PM