mercredi 1 mars 2017

Redirect all users hitting top level site

I have a site hierarchy in SP looking like this:

http://acme.com

    http://acme.com/hr

    http://acme.com/it

Under each page there are lists and libraries, etc. like this:

http://ift.tt/2lcyMcZ

http://ift.tt/2mKV95F

    http://ift.tt/2lcuAtO

    http://ift.tt/2mKVSDH

    http://ift.tt/2lcAFpS

    http://ift.tt/2mKRyVh

What I need is a javascript type redirect (not that great with JS) that will take anyone hitting http://acme.com should redirect the users to http://newAcme.com including every list and asset belonging to the acme page should forward list this:

http://acme.com -> http://newAcme.com
http://ift.tt/2lcyMcZ -> http://ift.tt/2lcJb8v
http://ift.tt/2mKV95F -> http://ift.tt/2mKQSPH

http://acme.com/hr -> no redirect
http://ift.tt/2lcuAtO -> no redirect
http://ift.tt/2mKVSDH -> no redirect
http://acme.com/it -> no redirect
http://ift.tt/2lcAFpS -> no redirect
http://ift.tt/2mKRyVh -> no redirect

To reiterate... anything belonging to the top level site should be redirected to the new top level site, any subsites under the old site should not redirect the user anywhere.

All I have so far is a script in the master page is:

<script type="text/javascript>
    window.location = "http://newAcme.com";
</script>

But all this does is redirect everyone on every page including the subsites (which I do not want a redirect on) on the old domain because the master page contains this code. My thoughts are just including the script on the actual top level page and not include it in the master page. Does anyone have any suggestions for this? I think I've clearly laid out what I am after. I appreciate any support.




Aucun commentaire:

Enregistrer un commentaire