Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id BB722200BB6 for ; Fri, 4 Nov 2016 23:32:09 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id B9F44160AFE; Fri, 4 Nov 2016 22:32:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0B1FE160AEA for ; Fri, 4 Nov 2016 23:32:08 +0100 (CET) Received: (qmail 99489 invoked by uid 500); 4 Nov 2016 22:32:07 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 99478 invoked by uid 99); 4 Nov 2016 22:32:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2016 22:32:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id EF227C1444 for ; Fri, 4 Nov 2016 22:32:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.733 X-Spam-Level: X-Spam-Status: No, score=0.733 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, NO_RDNS_DOTCOM_HELO=0.433, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id wr6z90Xq2rHD for ; Fri, 4 Nov 2016 22:32:05 +0000 (UTC) Received: from vms173015pub.verizon.net (vms173015pub.verizon.net [206.46.173.15]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 594E55FBDF for ; Fri, 4 Nov 2016 22:32:04 +0000 (UTC) Received: from vz-proxy-l004.mx.aol.com ([64.236.82.151]) by vms173015.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0OG5000LN2L7VS40@vms173015.mailsrvcs.net> for users@tomcat.apache.org; Fri, 04 Nov 2016 17:31:56 -0500 (CDT) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.2 cv=ZMenoTzb c=1 sm=1 tr=0 a=eaPqxu9IKnv3tbb7QsXVMw==:117 a=IkcTkHD0fZMA:10 a=L24OOQBejmoA:10 a=uPZiAMpXAAAA:8 a=j4nzMFrpAAAA:8 a=QfKxxUxMAAAA:8 a=3P5_umM87_D-UDY6rUAA:9 a=QEXdDO2ut3YA:10 Received: by 74.96.79.133 with SMTP id 63ac8058; Fri, 04 Nov 2016 22:31:56 GMT Subject: Re: Favicon for resources when using multiple webapps To: Tomcat Users List References: <2215C8CF-21EF-491C-892F-8FC5F77E6E79@providence.edu> From: Christopher Schultz Message-id: <1b398903-4e34-eb81-26e6-c6affa93b971@christopherschultz.net> Date: Fri, 04 Nov 2016 18:31:55 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-version: 1.0 In-reply-to: <2215C8CF-21EF-491C-892F-8FC5F77E6E79@providence.edu> Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 8bit archived-at: Fri, 04 Nov 2016 22:32:09 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Rebecca, On 11/3/16 4:16 PM, Maxfield, Rebecca A wrote: > Hi there, > > I have a Tomcat installation running a few different web apps > (different instances of XTF, if it matters), and each of these has > some resources (PDFs, raw XML, etc.) that can be viewed by the > user in the browser. How can I make sure that the user sees the > resource with the favicon of the correct site, since there’s > nowhere for me to put a tag like there is on the actual > pages of the site? You can't. Not really. But you might be able to fake it. > Looking into support forums beforehand, I found solutions for > giving a resource a favicon by putting the icon in the web apps > root folder so that it’s over the whole site (not good with more > than one webapp/site), and for making sites have different icons by > using the tags, but nothing that solves both of these > problems. This is why you can't do what you are asking to be able to do: the favicon "spec" is the the icon is in the root of the domain, unless overridden by a element in the HTML document. > I also tried a solution with htaccess but it didn’t work – not > sure if I wrote it badly or if that’s not the right way to go. I have no idea how you might do this with .htaccess. > This is on Linux; I think the version of Tomcat I’m sandboxing > this in is version 8, though the production server version is 7. Have a look at this SO answer: http://stackoverflow.com/questions/11227661/adding-favicon-through-a-htt p-header Here's a way you might be able to fake it: 1. Write a Filter (or you could do this with mod_rewrite I suppose) 2. Hook on the request for /favicon.ico 3. Examine the request headers for the REFERER (yes, it's misspelled) 4. Return the bits you want depending upon the value of that header This might not work for e.g. PDF files, but it would work for HTML files that don't specify their own elements. YMMV. - -chris -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJYHQxbAAoJEBzwKT+lPKRYUD0P/0Pz1xmhSVV/nNUPGBF3qxmj wWQPsbI+sK5I8X6+Yg19Cr/hjLmflsiENRq7PN7lPZ6S8lxbuCxRWwSlokWDRV8s 7dCaqbs9iPcEhd9Ey0rUwDAhR27H4x75MIA7e4dU0sVIGCsSiMYhw5OD6Td55IcZ PDfjL5drCI0193wkC+ac5sH56y1iU9KOfaxrzh5woXsQd25rZbPBA8nP5uWmS+Cy L0dEJ9UnLS3uBd4P4naKIy8Mrxd4OyWr67m03po5AaQwI3NkVLqkdG5fSfg6UN+w b58aN97cNPsToidIA8sYDOPUKFW1eRroBGLzaBL1JfKAIq/J61WRQ/NpuhugT0IM eqQ4KAEC1h4zzeAdF+Ak4G9N+AxOg95j7wvLN+c0klnYM5Uzw6ilW07E5tqLqWjM eOaP8AL2IMfeqg+ANlTIdzFsx3hKXtZchDQ2QGp0epqvW31XefHoLuaK8RH7JtQo 2DekKfJp8ssLun1IshkKYu+SsHH/QTTzhO16ygQc2/vtqJpe4WZ2iuDsfQwbpPEr NmVmF5WVJIG0ewcTSTz+8sl1NtpcqyMtRYMbikRXGZPXppahYtKyqVViM/SMDqMJ RB8meG+sFNb3M8NrLiwtbtCFax7rgjM2zbPneCNr8xEPBCF0Rx8XwhuSSiHOEcHY HfEiCDCsGD+fSvYZrHA7 =rRty -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org