This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Ignore Visual Studio temporary files, build results, and | |
## files generated by popular Visual Studio add-ons. | |
# Extensions | |
*.suo | |
*.user | |
*.sln.docstates | |
*.sln.cache | |
*.obj | |
*.pdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<rewrite> | |
<rules> | |
<!-- Remove/force the WWW from the URL. | |
You need to install the IIS URL Rewriting extension (Install via the Web Platform Installer) | |
http://www.microsoft.com/web/downloads/platform.aspx | |
** Important Note | |
using a non-www version of a webpage will set cookies for the whole domain making cookieless domains | |
(eg. fast cdn-like access of static resources like css, js and images) impossible. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
using Umbraco.Core; | |
using Umbraco.Core.Models; | |
using Umbraco.Web; | |
using Umbraco.Web.Routing; | |
public class PageNotFoundContentFinder : IContentFinder | |
{ | |
public bool TryFindContent(PublishedContentRequest request) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Avoid search engines (Google, Yahoo, etc) indexing website's content | |
This method is preferred to using robots.txt, which may still cause your site to | |
show in search engine result pages even if you have set to disallow. | |
http://yoast.com/prevent-site-being-indexed/ | |
http://code.google.com/web/controlcrawlindex/docs/robots_meta_tag.html | |
http://www.youtube.com/watch?v=KBdEwpRQRD0 | |
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Restrict access to Umbraco --> | |
<rule name="Restrict access" stopProcessing="true"> | |
<match url="umbraco(?!/Surface/)" /> | |
<conditions logicalGrouping="MatchAny" trackAllCaptures="false"> | |
<add input="{HTTP_HOST}" matchType="Pattern" pattern="admin.example.com" | |
ignoreCase="true" negate="true" /> | |
</conditions> | |
<action type="Redirect" url="/not-found" appendQueryString="false" /> | |
</rule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<UsingTask TaskName="TransformXml" AssemblyFile=".\Deploy\Microsoft.Web.Publishing.Tasks.dll" /> | |
<ItemGroup> | |
<ConfigFiles Include=".\*.$(Environment).config;.\config\*.$(Environment).config"> | |
<OriginalPath>%(ConfigFiles.RootDir)%(ConfigFiles.Directory)$([System.String]::Copy('%(ConfigFiles.Filename)').Replace('.$(Environment)',''))%(ConfigFiles.Extension)</OriginalPath> | |
</ConfigFiles> | |
<ConfigFiles Include=".\*.$(COMPUTERNAME).config;.\config\*.$(COMPUTERNAME).config"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class RegexPatterns | |
{ | |
public const string Postcode = "^(GIR 0AA|gir 0aa|[A-PR-UWYZa-pr-uwyz]([0-9]{1,2}|([A-HK-Ya-hk-y][0-9]|[A-HK-Ya-hk-y][0-9]([0-9]|[ABEHMNPRV-Yabehmnprv-y]))|[0-9][A-HJKPS-UWa-hjkps-uw]) {0,1}[0-9][ABD-HJLNP-UW-Zabd-hjlnp-uw-z]{2})$"; | |
public const string EmailAddress = "^[a-zA-Z0-9._%+-]+@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]{2,63}$"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// MediaEventHandler | |
/// Will hook into the MediaService saving event and apply some custom logic to ensure we have a valid media file. | |
/// </summary> | |
public class MediaEventHandler : ApplicationEventHandler | |
{ | |
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) | |
{ | |
MediaService.Saving += MediaService_Saving; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% include events.html previous=true year="2017" %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomMigrationEventHandler : ApplicationEventHandler | |
{ | |
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) | |
{ | |
// check target version | |
var rawTargetVersion = ConfigurationManager.AppSettings["app:MigrationVersion"] ?? "1.0.0"; | |
var targetVersion = SemVersion.Parse(rawTargetVersion); | |
if (targetVersion != null) | |
{ | |
HandleMigrations(targetVersion); |
OlderNewer