Java Script to redirect root site

Copper Contributor

Hi there,


let's say I use the domain After entering this address, the "root site" will open for me. In addition to this site, I created an Intranet site at


I wanted to be redirected to after entering in the browser.


Since the root website is in the "old" design, where I didn't figure out how to do this according to the instructions, I put the recommended script on the start page:


function corpRedirectPage() { 
	var urlParams = new URLSearchParams(;
	var stay = urlParams.get('stay');
	if (stay === 'true') { 
	window.setTimeout(function() { 
		window.location.href = ''; 
	}, 1500); 



I didn't change the target address to the first time I used it, which caused me to be redirected to "contoso" every time I load the


Even if I now insert a new script with the correct address, only the first "contoso" is still functional and it numbers the new javascripts.

Snímek obrazovky 2023-05-25 135415.pngSnímek obrazovky 2023-05-25 135524.png

Where can I view these applied JavaScripts on Sharepoint so that I can delete them and leave only the correct ones?


Thank you


0 Replies