Self built automatic access website Favicon icon api
Download source code
Github: https://github.com/owen0o0/getFavicon
Gitee: https://gitee.com/iowen/getFavicon
Installation and use
-
Upload to the root directory of the website or the favicon folder -
The cache folder gives 755 permissions -
Then visit http://you.url/favicon/get.php?url=https://www.iowen.cn -
It is recommended to delete the cache and try again if the data cannot be obtained -
notes : In the text faviconw For the api folder, set as appropriate
Customizations
/*------ Parameter Setting ------*/ $defaultIco='favicon.png'; // Default icon path $expire = 2592000; // The cache validity period is 30 days, and the unit is: seconds. When it is 0, no cache is available /*------ Parameter Setting ------*/
Pseudo static
Select corresponding rules according to the environment: #Nginx rule rewrite ^/favicon/(.*)\.png$ /favicon/get.php? url=$1; #Apache rules <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^favicon/(.*)\.png$ favicon/get.php? url=$1 [L] </IfModule>
Call method
Affordable CDN