I'm fairly new to SharePoint, and I was given the task of creating an application that basically consists of a couple of static pages that consume Java-based web services.

Currently, I'm creating these application pages with Visual Studio 2010, which automatically maps them to the Layouts folder, therefore making my pages accessible as http://localhost/_layouts/MyApplication/MyCustomApplicationPage.aspx.

What I'd like to do, is to customize these URLs, and structure my application pages in several directories, in order to access them as, for example, http://localhost/MyCustomDirectory/MyCustomApplicationPage.aspx, instead of http://localhost/_layouts/MyCustomDirectory/MyCustomApplicationPage.aspx.

In other words, I'd like to remove the _layouts part from the URL, and replace it with my own subdirectories. Is this possible without creating virtual directories in IIS? I do not have physical access to the server; all I can provide is a WSP.

2 Answers 2


No, that's not possible in SharePoint, application pages should be in the _layouts folder (or _admin for application pages for central admin).

You can put pages as http://localhost/MyCustomDirectory/MyCustomApplicationPage.aspx, but then they should be site pages, which you provision using a "Module" element from Visual Studion. But be aware that then users will be able to modify them using SharePoint designer.

Technically it's possible to put application pages in another path by introducing new IIS virtual directories, but you shouldn't do that.

  • Thanks for the answer (I'd upvote it, but it requires 15 reputation). I have just a few more questions. The IIS virtual directory is out of question since I do not have physical access to the server, so everything has to be set up with a WSP. Using a Module, I could create my custom directory, and add my application page to it. Would I be able to access SPContext, and set DynamicMasterPage using this strategy? Also, regarding user modification, is there any way to prevent it from happening? Thanks. Apr 1, 2012 at 11:27
  • If you put all the logic in a control and/or inherit from a class other than WebPartPage, then there is very little that SharePoint Designer can do. And, if users need to customize the page, well that is what WebPart pages are fore. Apr 1, 2012 at 14:14
  • You have full access to SPContext, but there is no need for using DynamicMasterPage, you just set MasterPageFile to the dynamic token. You can still inherit the page from your own class, but note that if you don't register that class as a SafeControl, then the page stop working if a user customizes it using SharePoint Designer Apr 1, 2012 at 16:25

It is possible.

Install CKSDEV on your development machine, and then add a Basic Site Page to your project. While that SPI won't give you a code behind file, you can certainly tweak it to use one, just like any other ASP.NET page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.