When user goes to
http://site/web/ I do not want them to be redirected to that web's welcome page,
How can I disable this redirection?
I am fully aware this would result in a 404 error which is what I want.
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.Sign up to join this community
Here is what I came up with:
web.AllowUnsafeUpdates = true; SPFolder rootFolder = web.RootFolder; rootFolder.WelcomePage = ""; rootFolder.Update(); web.AllowUnsafeUpdates = false;
This works great. Will probably add this snippet to an event receiver when new webs are created.
Note: Setting the Welcome Page to nothing (
"") can only be done pragmatically. The
/_Layouts/AreaWelcomePage.aspx page won't let you do this.