Wordpress Multisite Favicon.ico

Wondering if anyone would know how to put in individual favicons for a Wordpress multisite installation on Centos 7, VM GPL? I have set the > Virtualmin > Server Configuration > Website Options > Website matches all sub-domains to yes, created a couple alias virtual servers.

Googling my inquiry, from this site: http://wordpress.stackexchange.com/questions/38903/favicon-and-multi-site they suggest putting some code in .htaccess and creating an icons folder. I guess that %{DOCUMENT_ROOT} would be the virtual server that I created the two alias VS under. I'm not sure if I can just cut and paste their code into my .htaccess

RewriteCond %{REQUEST_URI} ^/favicon\.ico
RewriteCond %{SERVER_NAME} ^(www\.)?([a-z0-9]+)
RewriteCond %{DOCUMENT_ROOT}/icons/%2.ico -f
RewriteRule . /icons/%2.ico [L]

There's also this link: http://pididu.com/wordpress/blog/add-unique-favicons-for-multiple-blogs-... which suggests making a child theme, putting some code in the functions.php, and uploading the favicon to the uploads directory of that site. The previous solution above seems easier to me.

Closed (fixed)


Howdy -- while I'm not familiar with setting up favicons in WordPress, I can offer that you may be able to copy and paste that code into a .htaccess file in your public_html folder.

It appears to be setup to look for a favicon in the /icons/ directory, so you'd just need to make sure your image is stored in there.

unborn's picture
Submitted by unborn on Tue, 01/10/2017 - 04:18 Pro Licensee

hi oneearth and guys, I am familiar very much with wp and I would like to give oneearth some suggestions as this have nothing to do with virtualmin/webmin so this can be closed as fixed .

For multi-site wp install, I would suggest you to give favicons directly to each theme (in header.php) and store them in your theme folder or as you suggested in your second part of your post, create child theme - that suggestion is correct as well.

Perhaps you wont upload to each site favicons manually or store those in your theme folder you can create cdn on your server and upload files for share for others there and then in your header.php or in your child themes you will just use classic https:// links. This is fantastic as it will allow you to generate automatic update not only for favicon.ico icons but all favicon formats and sizes for all devices - means update them on a go (instead of going via ssh and upload favicons for each theme/site manually, you will just re-upload newer version of old favicons into one location and it will be changed right a way without even touching your themes or child themes or logins). You can even host there js | css or even child themes them selves there and update them on a go as you need.. It all depends on your needs.

I would not go with some configs in .htaccess files - that could be messy and if apache will get updated, it could cause some funny issues, you never know.

update - for correct info about child themes you should follow https://codex.wordpress.org/Child_Themes

thanks for all that @unborn. i think that you've packed a lot in a few sentences and it will take me some time to decipher what exactly is involved.

regarding child themes, i am using the Headway framework for several sites, and will have to investigate child themes in Headway.


i don't have time right now to digest that and try it out but will give it a try when i have time.

unborn's picture
Submitted by unborn on Thu, 01/12/2017 - 03:05 Pro Licensee

Hi oneearht, if you running linux desktop or server (script works with imagemagic and I am not using windows since 2008) I can write you very simple shell script which will generates favicon for you from logo or image you whish to have as an favicon - all sizes for all devices. Also it will create txt file with all metatags for favicons which you could use as copy and paste. I can even add few lines which will actually upload those favicons to cdn folder on your server.. or even generates you new child theme with all set up, so no coding is need it - its very simple ;)

@unborn: thanks for your generous offer - that sounds wonderful. i am running centos 7.3 server for my webhosting. i would definitely be interested.

thanks @unborn for that - i haven't had a chance to try it and wanted to thank you.

Status: Active ยป Closed (fixed)