Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a favicon.ico to a PHP website?

All I want to do is add a favicon.ico to my PHP website. Is there a simple PHP way of doing this or can it only be done with an HTML reference page?

Maybe using some jQuery/Ajax/JavaScript?

like image 590
Pierre Pretorius Avatar asked Nov 28 '22 17:11

Pierre Pretorius


1 Answers

By default, most browsers will try to resolve the favicon.ico, even if you do not mention it in the HTML of the website (just make sure the file is in the root of the website directory). However, for compatibility, you should add the html code for it in the section of your web page.

<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
like image 195
Kovo Avatar answered Dec 04 '22 06:12

Kovo