I want to change the favicon of resources html display pages. I mean when i go to the image url i want to see my icon in the title bar not the icon of the server (in my case XAMPP).
Change the favicon in an image url
8.8k views Asked by Artifex12 AtThere are 4 answers
Just put an ICO file named favicon.ico
in document root.
A quick test is to open the URL http://my.domain/favicon.ico
in a browser; it should display the icon.
Note that the icon file MUST be in document root.
If you can't put the file there physically, you could use Apache's mod_alias
to map the file to this URL.
This is done by placing the following line in your server's configuration (httpd.conf
file):
alias /favicon.ico /path/to/your/images/directory/favicon.ico
As the other posters have stated, you need to edit your HTML and in the section, add the line to show the favicon you have uploaded.
If you look at the source for this page, the line defining the favicon is this:
<link rel="shortcut icon" href="//cdn.sstatic.net/stackoverflow/img/favicon.ico?v=6cd6089ee7f6">
but the code stated elsewhere here will also work (<link rel="icon" type="image/x-icon" href="favicon.ico"/>
)
Many browsers will automatically look for the favicon.ico in the root of the webserver (as Alex Shesterov wrote in a comment)
use this
Read this Blog Article as well