Favicon in subdirectory all subdomain

前端 未结 5 1226
暗喜
暗喜 2021-01-17 20:27

I am used to just save the favicon.ico in the public_html folder for adding the favicon.

The problema I have now is that I want to display the in all th

相关标签:
5条回答
  • 2021-01-17 20:30

    redirect favicon.ico url for all subdomains to public_html's favicon.ico

    ie. subdomain.website.com/favicon.ico should go to www.website.com/favicon.ico

    0 讨论(0)
  • 2021-01-17 20:31

    Adding the <link> element is the right way to go. Use a template engine (e.g. Template-Toolkit) to avoid duplicating common content manually.

    0 讨论(0)
  • 2021-01-17 20:32

    As mentioned above don't waste time on searching. is the only way in that case. When you will be checking out results of your markup changes, remember that browser cache can be tricky.

    0 讨论(0)
  • 2021-01-17 20:35

    You will have to specify the favicon using the link rel=... notation.

    Browsers will search only in the root directory of the domain for a default /favicon.ico. Any variations from that you have to specify explicitly.

    0 讨论(0)
  • It might not be the most elegant way, and i came here to find a solution. Unfortunaly the given answers did not suited for me.

    In my case i working on a localhost (via private ip)

    this is what i did :

            <link rel="icon" href="<?php echo rtrim($_SERVER['PHP_SELF'], basename($_SERVER['PHP_SELF'])); ?>favicon.ico" type="image/x-icon">
    
    0 讨论(0)
提交回复
热议问题