public static bool IsInSpecialDirectory(string folderName)
{
// Either "" or "Subtext.Web" for ex...
String appPath = StripSurroundingSlashes(HttpContext.Current.Request.ApplicationPath);
if(appPath == null)
appPath = string.Empty;
if(appPath.Length == 0)
appPath = "/" + folderName + "/";
else
appPath = "/" + appPath + "/" + folderName + "/";
return HttpContext.Current.Request.Path.IndexOf(appPath, StringComparison.InvariantCultureIgnoreCase) >= 0;
}