Redirecting a SharePoint Subsite or a Site collection to a different URL
Lots of times I have been asked this question if there is a way to redirect a subset to a different URL
I have seen many people trying this by playing around AAM and at the IIS level. I will try to put bit of light on both of them and will also show you a easy way out of it
1) AAM(Alternate Access Mapping)
This option will not work out as we cannot add Subsite URL in this. For Example we can add the following types of URL in the AAM
A) https://ServerName
B) https://FQDN
Now this is good if you want to do a redirect of the whole url where if browse to https://ServerNameA we are redirected to https://ServerNameB but this option will not help in redirecting a Subsite to a different URL
2) IIS Level
We can redirect a Virtual Dir with help of this. But SharePoint Subsite wont show up in IIS as they are stored in database. So one way we can think is create a Virtual dir of each URL you want to redirect then create exclusion in SharePoint and redirect it from IIS
Now if you several Subsites then this is a not a good option.
Following are the steps which will help us in redirecting any level of site in SharePoint in a pretty neat manner. We will try to redirect https://mosssps/sites/Team/default.aspx to https://mosssps
1) We will open the site in Web Folder view
2) Download default.aspx page of the site which we want to redirect. There are other ways to access default.aspx page too.
3) Open the default.aspx in notepad and delete all the contents of it
4) Add the following code to it
<%@ Page language="C#" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" %>
<script>
window.location.href = "https://mosssps/Pages/Default.aspx";
</script>
5) https://mosssps/Pages/Default.aspx is the URL where we want it to redirect if browse to https://mosssps/sites/Team/default.aspx
6) Upload the Default.aspx and now when you browse to https://mosssps/sites/Team/default.aspx it will redirect to https://mosssps/Pages/Default.aspx.
Note- I have only tested this on Moss.If you are intending to use this for V2 then you may wanna test this first
Comments
Anonymous
January 01, 2003
Is there something equivalent for SharePoint 2010? We have changed the web application for a site collection, the old site collection is still available in read-only mode (via the Quota and Locks option in the Central Administration): we're looking for a way to redirect the old home page to the new one.Anonymous
January 01, 2003
Great post...much appreciatedAnonymous
January 01, 2003
I have documented it by using content editor webpart :
http://msexchange.me/2014/09/07/redirect-sharepoint-page-to-different-url/Anonymous
July 11, 2012
Does anyone know what it means to create exclusion in SharePoint mentioned on option # 2 (IIS level)? I am interested in that option as I only need to redirect one siteAnonymous
January 07, 2013
THANK YOU SO MUCH!!. I have in sub-site that I manage in Sharepoint 2010 and I had to rename the site but not lose the old URL as many people had it saved in their favorites. With no access to the server environment, I was able to use this code to replace the code of my old site to redirect to the new site name, renamed the old site to the new site name and everything is working great!Anonymous
January 22, 2014
Thanks for the post. I've used the code in the default.aspx file to redirect from on an on-premise SP environment to another SP environment, but now I'm wondering if it'll work to redirect for an on-premise SP environment to the Online site? Or if there is another option for that?ThanksKimAnonymous
March 11, 2014
How about if they have a bookmarked the sub sites ug document library this won't work.
Any idea?
Thanks!Anonymous
April 28, 2014
But this will only redirect the home page. What is users try to directly hit a list or library within the site and have favorites pointing to the content instead of the home page ?Anonymous
May 27, 2014
Pingback from How to redirect user to other site collection in same web application? - FAQs SystemAnonymous
June 02, 2014
Add a content editor web part on the page you wanted to re-direct and edit HTML to addAnonymous
October 15, 2015
Nice Article. ThanksAnonymous
October 26, 2015
As a Newbie, I am constantly exploring Online for articles that can be of assistance to me.Thank youhttp://staygreenacademy.com/sharepoint-developer-training-online/Anonymous
December 21, 2015
Time wasteAnonymous
January 12, 2016
thanks
5starhoroscopes.com
http://www.5starhoroscopes.com/
http://www.5starhoroscopes.com/2015/11/luck-today.html
http://www.5starhoroscopes.com/2015/11/blog-post96.html
http://www.5starhoroscopes.com/2015/11/blog-post94.html
http://www.5starhoroscopes.com/2015/11/blog-post95.html
http://www.5starhoroscopes.com/2015/11/blog-post93.html
http://www.5starhoroscopes.com/2015/11/blog-post92.html
http://www.5starhoroscopes.com/2015/11/blog-post91.html
http://www.5starhoroscopes.com/2015/11/blog-post89.html
http://www.5starhoroscopes.com/2015/11/blog-post90.html
http://www.5starhoroscopes.com/2015/11/blog-post88.html
http://www.5starhoroscopes.com/p/blog-page.html
http://www.5starhoroscopes.com/2015_11_01_archive.html