如何使用htaccess为所有页面设置网站图标默认值 [英] How to set favicon default for all pages using htaccess

查看:54
本文介绍了如何使用htaccess为所有页面设置网站图标默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用htaccess为网站中的所有文件设置Favicon?

I want to Set Favicon for All files in my site using htaccess ??

推荐答案

而不是在htaccess中指定Favicon您最好在每个页面的HEAD区域中使用以下META标记:

Rather than specifying a Favicon in htaccess you would be better off using the following META tag within the HEAD area of every page:

<link rel="shortcut icon" href="http://example.com/myicon.ico" />

如果这不可能(也许您的静态网站很大),您可以简单地存储文件(将其命名为favicon.ico)在您网站的根文件夹(例如/ public_html /)中,因为浏览器会首先自动在该目录中查找。

If this is not possible (perhaps you have a very large static website) you can simply store the file (name it favicon.ico) in your website's root folder (e.g. /public_html/) as browsers will automatically look there first.

这篇关于如何使用htaccess为所有页面设置网站图标默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆