There can be some cases we may need to redirect some page or even home to another site or site collection (sub site may be). I observed that some developers trying from AAM or IIS but here I show easiest ways.

There can be multiple ways to active this task.

Easiest way using Js.

window.location = "http://new-site/";
  • Take a copy of page (you want redirect)
  • remove all content
  • Add only redirection code:<%@ Page language=”C#” Inherits=”Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c” %>window.location.href = “http://new-site/“;

Another option:

simple add Js in Page:

window.location.href = “http://new-site/“;
Another way to change in meta data of Master page:

  • Go to mater page
  • Add <meta http-equiv=“Refresh” content=“1; url=http://new-site/”>

Thanks!!

 

By Rijwan Ansari

Research and Technology Lead | Software Architect | Full Stack .NET Expert | Tech Blogger | Community Speaker | Trainer | YouTuber. Follow me @ https://rijsat.com Md Rijwan Ansari is a high performing and technology consultant with 10 plus years of Software Development and Business Applications implementation using .NET Technologies, SharePoint, Power Platform, Data, AI, Azure and cognitive services. He is also a Microsoft Certified Trainer, C# Corner MVP, Microsoft Certified Data Analyst Associate, Microsoft Certified Azure Data Scientist Associate, CSM, CSPO, MCTS, MCP, with 15+ Microsoft Certifications. He is a research and technology lead in Tech One Global as well as leading Facebook community Cloud Experts Group and SharePoint User Group Nepal. He is a active contributor and speaker in c-sharpcorner.com community, C# Corner MVP and his rank at 20 among 3+ millions members. Additionally, he is knee to learn new technologies, write articles, love to contribute to the open-source community. Visit his blog RIJSAT.COM for extensive articles, courses, news, videos and issues resolution specially for developer and data engineer.

Leave a Reply

Your email address will not be published.