Typo3 9.5.9版本更换Favicon失败,已清缓存仍未解决
Got it, let’s work through your favicon issue in TYPO3 9.5.9 step by step—since you’ve already followed the basic guide and cleared caches, let’s dive into the version-specific quirks that might be tripping you up.
Double-check your favicon’s location & naming
Make sure yourfavicon.ico(orfavicon.pngif you’re using that format) is placed directly in your website’s web root directory (the folder whereindex.phplives). TYPO3 9.x defaults to looking here first, but if you put it in a subfolder liketypo3conforfileadmin, it won’t pick it up automatically. Also, confirm the file name is exactlyfavicon.ico(case-sensitive on some servers).Inspect your template’s HTML head
Often, custom templates hardcode the TYPO3 default favicon link, which overrides the root directory file. Open your template’s header file (usually infileadmin/templatesor your extension’s template folder, named something likeHeader.html) and look for<link rel="icon">tags. If you see one pointing totypo3/sysext/core/Resources/Public/Icons/favicon.ico, replace it with your own path:<link rel="icon" type="image/x-icon" href="/favicon.ico"> <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">If you’re using a Fluid template, check for
<f:be.pageRenderer>or similar view helpers that might be injecting the default favicon—update their parameters to point to your file.Verify Site Management configuration
TYPO3 9.x introduced the Site Management module, which might have a favicon setting you missed. Go to the Site module in the left menu, select your site, and switch to the Configuration tab. Look for afaviconentry; if it’s present, make sure it points to your file (e.g.,/favicon.ico). If not, add it manually to the YAML config:favicon: '/favicon.ico'After saving, be sure to click the Clear all caches button (top bar, not just page cache) to apply the change.
Check server-side caching & permissions
If your server uses static caching (like Apache’s mod_pagespeed or Nginx’s fastcgi_cache), clear that cache too—these systems might be serving the old favicon even after you’ve updated it. Also, verify your favicon file has correct permissions: set it to644and its parent folder to755so the web server user (e.g.,www-data) can read it.Test direct access to the favicon
In your browser’s address bar, go directly tohttps://yourdomain.com/favicon.ico(replace with your actual domain). If this loads the old TYPO3 icon or gives an error, your file path is wrong or the file isn’t accessible. Fix the path or permissions before moving on.Force a full browser refresh
Even after clearing cache, browsers sometimes hold onto old resources. Try opening your site in incognito/private mode, or useCtrl+Shift+R(Windows/Linux) orCmd+Shift+R(Mac) to force a hard refresh that skips local cache.
内容的提问来源于stack exchange,提问作者Adi

