Custom Default Masterpage for all Site Definitions in WSS 3.0

How to set a custom default masterpage for all site definitions in WSS3 ?
How can we deploy the new custom masterpage for all site definitions ?

1). Put the new masterpage in the following directory: "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL"

2). Go to "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL\XML" and open the ONET.XML.

3). At the bottom of the page add a new masterpage entry so it will look something like this:

'<'Modules'>'
'<'Module Name="DefaultMasterPage" List="116" Url="_catalogs/masterpage" RootWebOnly="FALSE"'>'
'<'File Url="[any name].master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" /'>'
'<'File Url="default.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" /'>'
'<'/Module'>'
'<'/Modules'>'

This code will automatically put your custom masterpage into the masterpage gallery when a new site is created.

  • Change the default masterpage to the new one. Look for the following line: and change it to your new masterpage.
  • Hit save, and do an IISRESET.

Now create a new site and the new masterpage is set automatically.

Beware that when you create a masterpage with SharePoint designer you cannot just export the masterpage to the filesystem, because it will mess up your masterpage code. You can better copy the masterpage code to notepad, and save it as your masterpage on the filesystem.