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.
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.