[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 09-12-2005, 11:46 PM   #1 (permalink)
RJ
NamePros Founder

Administrator

 
Join Date: Feb 2003
Location: Bay Area, CA
Posts: 13,173
104,201.68 NP$ (Donate)

RJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatness

Find Marrow Donors! Cystic Fibrosis
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?

RJ is offline  
Old 09-13-2005, 12:02 AM   #2 (permalink)
Senior Member
 
dgaussin's Avatar
 
Join Date: May 2004
Location: France
Posts: 1,294
85.60 NP$ (Donate)

dgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to behold


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
dgaussin is offline  
Old 09-13-2005, 12:21 AM   #3 (permalink)
RJ
NamePros Founder

Administrator

 
Join Date: Feb 2003
Location: Bay Area, CA
Posts: 13,173
104,201.68 NP$ (Donate)

RJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatness

Find Marrow Donors! Cystic Fibrosis
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?
RJ is offline  
Old 09-13-2005, 12:37 AM   #4 (permalink)
Senior Member
 
dgaussin's Avatar
 
Join Date: May 2004
Location: France
Posts: 1,294
85.60 NP$ (Donate)

dgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to behold


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;
dgaussin is offline  
Old 09-13-2005, 12:52 AM   #5 (permalink)
RJ
NamePros Founder

Administrator

 
Join Date: Feb 2003
Location: Bay Area, CA
Posts: 13,173
104,201.68 NP$ (Donate)

RJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatness

Find Marrow Donors! Cystic Fibrosis
Quote:
Originally Posted by dgaussin
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;
Thanks, David. I was trying to make it more complicated than I needed to. 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"
RJ is offline  
Old 09-13-2005, 12:57 AM   #6 (permalink)
Senior Member
 
dgaussin's Avatar
 
Join Date: May 2004
Location: France
Posts: 1,294
85.60 NP$ (Donate)

dgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to behold


Seems favicon has a lot of mime type
The best is to use the mime type used by the server...
dgaussin is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
NUMB3RS: What’s the deal with 4-Digit Domains (NNNN)? paxton "Short" Domain Discussion 143 06-05-2009 07:58 PM
FREE HOT Expiring domains list Tools Vonna.com Domain Newbies 34 03-21-2006 02:21 PM
Parked domains penalized? kektex Search Engines 3 07-07-2005 11:52 AM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 07:42 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85