Skip to content

Instantly share code, notes, and snippets.

@cfalzone
Created July 17, 2014 19:03
Show Gist options
  • Save cfalzone/a3b16f1393318164c3d7 to your computer and use it in GitHub Desktop.
Save cfalzone/a3b16f1393318164c3d7 to your computer and use it in GitHub Desktop.
// Rewrite Rule for Cross Domain Web Fonts
// This allows web fonts to be shared across hosts, primarily a cross-site security restriction in Firefox.
NormalRule rule = new NormalRule();
rule.setName("CrossDomainWebFontsHeader");
rule.setFrom("\\.(eot|ttf|otf|woff)");
SetAttribute set = new SetAttribute();
set.setType("response-header");
set.setName("Access-Control-Allow-Origin");
set.setValue("*");
rule.addSetAttribute(set);
addRewriteRule(rule);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment