Problem: A particular SharePoint site’s Home page URL leads to 404 page not found error. While all other pages were working without any issues, On hitting the Home page URL, observed it is redirecting to some other URL that doesn’t exist!

Root cause:
Usually, these kinds of redirects are placed in CEWP using JavaScript. So, opened the page in SharePoint designer, tried locating the script, But could not find any such things.
404 page not found cewp redirect
After an hour, found the problem. Actually, the user has placed a content editor web part and set the “content link” as an external website’s URL. That external website URL was redirecting to some other URL on page load, which altered the actual SharePoint site URL. See the screen above:

content editor web part tries redirect

Solution:

Simple! Delete the content editor web part with “Content link” pointing to a site, which redirects! Just append ?contents=1 to the SharePoint site URL and close/delete the web part in the Web part maintenance page.

Source link