Did you ever want to tinker with some of the ASPX pages in the
layouts folder of the SharePoint hive? You might want to customize the appearance of application.master, for example. Or, you might want to diverge from the released _layouts pages so that some web apps use your customized versions. When Microsoft releases patches, they’ll be installed in the hive, thereby giving you the chance to run a
diff to see what you need to migrate into your copied folder. With sufficient permissions, you can edit the layouts pages directly of course, but it’d be safer to work with your own private copy until you know your changes are safe to be unleashed on an unsuspecting populous. Here’s how to point a web app at your local copy of the layouts folder.
- Make your own copy of the layouts folder
SharePoint’s _layouts pages are at this oh-so-easy-to-remember location:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extension\12\template\layouts. Copy this folder and paste it wherever you want if you’re just hacking around. If you plan to run a production web app from your copy of layouts, a good place to put the copy might be
C:\Inetpub\wwwroot\webapps\your_web_app\layouts. You might have to adjust the file system permissions on the folder containing your layouts copy — whichever user your web app runs as (typically ASPNET) will need Read access.
- Point your web app at your copy
Open IIS Manager, navigate to your web app, and expand the tree so that you can see the _layouts folder; it will look like the figure below.
Right-click the _layouts folder, and select Properties from the context menu. On the Virtual Directory tab, select the radio button indicating that the content should come from “A directory on this computer” and in the Local path field, enter the full path to the location of your copy of the layouts folder. Make sure the box for Read access is checked, and check any others that pertain. Then click OK.
- Run the
Your app will now use the files in your copy of layouts for all of SharePoint’s _layouts pages.