| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Webmaster ![]() ![]() ![]() Join Date: Feb 2003
Posts: 12,930
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Different favicons for a parked domains? Quandary: How can I serve a different favicon for a parked domain? I have several parked domains using the same hosting account. PHP is used to detect the domain and serve different content for that domain. I'd like to also serve a different favicon.ico for each of the parked domains. What's the solution? |
| |
| | #2 (permalink) |
| Senior Member Join Date: May 2004 Location: France
Posts: 1,226
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | I'm sure there's a lot of solution, but the first way I'd try is the following. In the .htaccess use ForceType to force Apache to use PHP handler when delivering the file "favicon.ico". Write a simple php script returning the .ico mime type then an .ico content file and use your database to pick up the right favicon.ico That could be worked |
| |
| | THREAD STARTER #3 (permalink) |
| NamePros Webmaster ![]() ![]() ![]() Join Date: Feb 2003
Posts: 12,930
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | I like that solution a lot. Serving favicon.ico as a forced PHP script and using it to pick the right .ICO file would probably work great. To serve a PNG file I would do this, $im = imagecreatefrompng("test.png"); imagepng($im); How would you do the same thing with .ICO files? |
| |
| | #4 (permalink) |
| Senior Member Join Date: May 2004 Location: France
Posts: 1,226
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | You don't have to create an .ico file, just open and read an .ico file and send the content to browser. Even somethig like could work : $icon = file_get_contents('domain1.ico'); header ("Content-type: image/jpeg"); echo $icon; |
| |
| | THREAD STARTER #5 (permalink) | ||||
| NamePros Webmaster ![]() ![]() ![]() Join Date: Feb 2003
Posts: 12,930
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Time to put this altogether now and code it. For future reference, I found that the MIME type for favicon files is "image/vnd.microsoft.icon" | ||||
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NUMB3RS: What’s the deal with 4-Digit Domains (NNNN)? | paxton | "Short" Domain Discussion | 176 | 01-26-2012 04:42 PM |
| FREE HOT Expiring domains list Tools | Vonna.com | Domain Newbies | 34 | 03-21-2006 03:21 PM |
| Parked domains penalized? | kektex | Search Engines | 3 | 07-07-2005 12:52 PM |
| WHOLESALE List of Sports & Fitness Domains | Duke | Domains For Sale - Make Offer | 4 | 09-03-2003 12:58 PM |