DotNetNuke(DNN) 9.1.1:内网替换FontAwesome CDN为本地资源
Fixing FontAwesome CDN Load Failures in DNN 9.1.1 (Local Network)
Let's break down where FontAwesome might be configured to load from CDN in your DNN instance, and walk through how to switch it to local loading:
1. Check Your Active Skin & Container Files
This is the most common culprit—DNN skins almost always handle front-end resource references:
- Navigate to
Portals/_default/Skins/[YourActiveSkin](orPortals/[PortalID]/Skinsif you're using a portal-specific skin) - Open all
.ascx,.ascx.cs, and.htmlfiles (for HTML-based skins) in a text editor - Search for strings like
fontawesome,cdnjs.cloudflare.com, orfontawesome.comto locate the CDN<link>tag - Replace that CDN link with a local reference:
- Download the exact FontAwesome version your site was using (check the failed CDN request URL to get this number)
- Extract the CSS and font files into folders like
Portals/_default/Skins/[YourActiveSkin]/cssandPortals/_default/Skins/[YourActiveSkin]/fonts - Update the
<link>tag to use a relative path, e.g.:<link rel="stylesheet" href="<%= SkinPath %>css/font-awesome.min.css" />
2. Audit the Client Resource Management Framework (CRMF)
DNN uses CRMF to register and load client resources globally. Even if you didn't find references in skins, the core might have it registered:
- Double-check the
ClientResourcetable in your DNN database (look for entries withFontAwesomein theNameorUrlcolumn) - If you find a CDN entry, update the
Urlto point to your local file path (e.g.,~/Portals/_default/Skins/[YourSkin]/css/font-awesome.min.css) - If no existing entry exists, you can register the local resource via the CRMF API in a custom module or skin code-behind, but updating an existing entry is cleaner.
3. Check Third-Party Modules
Some modules (like blogs, forums, or custom-built ones) might embed their own FontAwesome CDN references:
- Navigate to
DesktopModules/[ModuleName]for each installed module - Search through their
.ascx,.cshtml, or.htmlfiles for FontAwesome CDN links - Replace those with your local path, following the same pattern as the skin step.
4. Verify DNN Core Resource Registrations
In DNN 9.1.1, the core might include FontAwesome in default resource bundles:
- Look in
~/Admin/Skins/or~/DesktopModules/Admin/ControlPanel/for files that register client resources - Search for
FontAwesome—you might find a line likeClientResourceManager.RegisterStyleSheet(this, "https://cdn..."); - Modify that line to use your local file path instead of the CDN URL.
5. Check Skin Settings in DNN Admin
Some skins include admin-configurable options for resource loading:
- Log into your DNN admin panel
- Go to Site Settings > Appearance
- Check if your active skin has any toggles for CDN vs local FontAwesome loading—switch it to local if available.
Pro Tips
- Always match the local FontAwesome version to the CDN version your site was using (icon classes can change between versions)
- After making changes, clear DNN's cache via Host > Host Settings > Performance to ensure the new resource paths take effect
- Test all pages to confirm icons render correctly—some modules might rely on specific icon classes that only exist in certain versions.
内容的提问来源于stack exchange,提问作者ar099968
相关产品推荐
相关产品推荐

