locked
Alternate Access Mapping and URL redirection RRS feed

  • Question

  • We have an intranet on SharePoint 2013 Enterprise. Currently, we have been using an intranet zone (http://*****.local) for all internal devices, and an extranet (http://*****.co.uk) for externally connecting devices. Due to a business change (too boring to discuss here!), we now need to change it so that the all connections, internal and external, use the extranet connection string (http://*****.co.uk) - i.e. if someone on the internal network accesses a URL with the "****.local" string (e.g. http://*****.local/pages/home.aspx), they are sent - in the browser address bar - to the extranet URL (e.g. http://*****.co.uk/pages/home.aspx.)

    What changes do I need to make to my existing farm to make this happen?

    Tuesday, June 30, 2015 6:12 AM

Answers

  • Please try to use URL rewrite module for IIS and create a rule that will redirect all request to ***.local to ***.co.uk, you have to remove the ***.local from AAM, but keep the host header in IIS.

    here is an example of the rewrite rule you could paste it directly in web.config:

    <rewrite>
                <rules>
                    <rule name="redirect" stopProcessing="true">
                        <match url="(.*)" />
                        <conditions>
                            <add input="{HTTP_HOST}" pattern="^(www.)?contoso\.dev\.local$" />
                        </conditions>
                        <action type="Redirect" url="http://somethingelse.co.uk" />
                    </rule>
                </rules>
            </rewrite>
      </system.webServer>

    Hope this helps.


    Tuesday, June 30, 2015 1:38 PM

All replies

  • Hi

    try adding a CNAME reg in your DNS

    After thest if your http://***.local it is resolved to http://***.co.uk


    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

    Tuesday, June 30, 2015 6:22 AM
  • Thanks for coming back to me, Romeo. What if I don't have control over the company DNS? Is there a SharePoint/IIS way of doing it?
    Tuesday, June 30, 2015 12:59 PM
  • Hi

    check this doc

    http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=48


    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

    Tuesday, June 30, 2015 1:25 PM
  • You can use IIRF in IIS to build redirects to do exactly what you are trying to do. Note that this can hinder performance, and break the site if you cause a redirect loop. What you want to do should be fairly easy though.

    https://iirf.codeplex.com/

    • Proposed as answer by nbrattoliMVP Tuesday, June 30, 2015 4:11 PM
    Tuesday, June 30, 2015 1:26 PM
  • Please try to use URL rewrite module for IIS and create a rule that will redirect all request to ***.local to ***.co.uk, you have to remove the ***.local from AAM, but keep the host header in IIS.

    here is an example of the rewrite rule you could paste it directly in web.config:

    <rewrite>
                <rules>
                    <rule name="redirect" stopProcessing="true">
                        <match url="(.*)" />
                        <conditions>
                            <add input="{HTTP_HOST}" pattern="^(www.)?contoso\.dev\.local$" />
                        </conditions>
                        <action type="Redirect" url="http://somethingelse.co.uk" />
                    </rule>
                </rules>
            </rewrite>
      </system.webServer>

    Hope this helps.


    Tuesday, June 30, 2015 1:38 PM