Return-Path: X-Original-To: apmail-httpd-users-archive@www.apache.org Delivered-To: apmail-httpd-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7360117CD7 for ; Thu, 17 Sep 2015 21:35:55 +0000 (UTC) Received: (qmail 95135 invoked by uid 500); 17 Sep 2015 21:35:36 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 95093 invoked by uid 500); 17 Sep 2015 21:35:36 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 95081 invoked by uid 99); 17 Sep 2015 21:35:36 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Sep 2015 21:35:36 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 4D1E71A226E for ; Thu, 17 Sep 2015 21:35:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.994 X-Spam-Level: *** X-Spam-Status: No, score=3.994 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.006] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id uFtkYzaQNp82 for ; Thu, 17 Sep 2015 21:35:34 +0000 (UTC) Received: from webmail.argodata.com (outbound.argodata.com [216.62.17.247]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 2EDAE204C8 for ; Thu, 17 Sep 2015 21:35:33 +0000 (UTC) Received: from SERV121.ARGO.LOCAL (172.20.20.158) by SERV754.ARGO.LOCAL (172.20.21.16) with Microsoft SMTP Server (TLS) id 14.3.210.2; Thu, 17 Sep 2015 16:35:31 -0500 Received: from SERV754.ARGO.LOCAL ([fe80::c9cb:765b:acd7:af58]) by Serv121.ARGO.LOCAL ([fe80::e55c:5efd:5ad4:3ad7%25]) with mapi id 14.03.0210.002; Thu, 17 Sep 2015 16:35:31 -0500 From: Paul Kuykendall To: "users@httpd.apache.org" Thread-Topic: Q: How to config for multi-MIME type of a given resource Thread-Index: AdDxjzZK5A6ftb7iRYmm/xnJ+YOVrQ== Date: Thu, 17 Sep 2015 21:35:30 +0000 Message-ID: <249739F7DF8DBD4D8A082EC507C2D4E5B5CD6690@SERV754.ARGO.LOCAL> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.20.25.3] Content-Type: multipart/alternative; boundary="_000_249739F7DF8DBD4D8A082EC507C2D4E5B5CD6690SERV754ARGOLOCA_" MIME-Version: 1.0 Subject: [users@httpd] Q: How to config for multi-MIME type of a given resource --_000_249739F7DF8DBD4D8A082EC507C2D4E5B5CD6690SERV754ARGOLOCA_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I need some help finding the relevant documentation and/or a solution for t= he following. Problem: I have an Apache httpd server that I want to use to serve a variety of diff= erent formats for the same resource URL. Some of the resources are simple = static files (OWL2 ontologies in this case serialized as both RDF/XML and T= urtle). Additionally I have a Tomcat service that I want to use to silently interce= pt requests text/html and application/xhmtl versions of the resource. I want the url rewrite/redirect/proxy to be invisible to the caller (http:= //example.com/ontology.owl with an Accept: text/html should go to http://e= xample.com/parrot/parrot?documentUri=3Dhttp://example.com/ontology.owl to g= enerate the proper HTML documentation output but not change the URL as a R= ewriteRule does, so that the user still thinks the URL is http://example.c= om/ontology.owl Use cases: GET http://example.com/v1/ontology.owl (Accept: application/rdf+xml) Returns the /v1/ontology.owl file found in the htdocs GET http://example.com/v1/ontology.owl (Accept: text/turtle) Returns the /v1/ontology.owl.ttl file found in the htdocs GET http://example.com/v1/ontology.owl (Accept: text/html) Returns the response from forwarding the request to a Tomcat webapp running= at http://example.com/parrot/parrot?documentUri=3Dhttp://example.com/ontology.= owl Additionally, I would like the URL to remain http://example.com/v1/ontology= .owl and not get rewritten or redirected where the client sees the webapp = service's URL. I currently have the following rewrite rules in place that do most of what = I want. RewriteCond %{HTTP_ACCEPT} !application/rdf\+xml.*(text/html|application/xh= tml\+xml) RewriteCond %{HTTP_ACCEPT} text/html [OR] RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml RewriteRule ^/v1/ontology.owl$ http://example.com/parrot/parrot?documentUri= =3Dhttp://example.com/v1/ontology.owl [L] RewriteCond %{HTTP_ACCEPT} application/rdf\+xml RewriteRule ^/v1/ontology.owl$ /v1/ontology.owl [L] # Rewrite rule to serve RDF/XML content from the vocabulary URI if requeste= d RewriteCond %{HTTP_ACCEPT} text/turtle RewriteRule ^/v1/ontology.owl$ /v1/ontology.owl.ttl [L,R=3D303] # Choose the default response # --------------------------- # Rewrite rule to serve the RDF/XML content from the vocabulary URI by defa= ult RewriteRule ^/v1/ontology.owl$ /v1/ontology.owl [L] How do I set up the config to handle the browser-friendly formats as descri= bed above? Any help would be appreciated. I've looked through the docs and searched t= he net, but am at a loss on figuring this one out. Thank you very much for reading through this massive wall of text. I appre= ciate any help given. /Paul --------------------------------------------------- Confidentiality Notice:= This electronic mail transmission is confidential, may be privileged and s= hould be read or retained only by the intended recipient. If you have recei= ved this transmission in error, please immediately notify the sender and de= lete it from your system. --_000_249739F7DF8DBD4D8A082EC507C2D4E5B5CD6690SERV754ARGOLOCA_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

 

I need some help finding the relevant documentation = and/or a solution for the following.

 

Problem:

 

I have an Apache httpd server that I want to use to = serve a variety of different formats for the same resource URL.  Some = of the resources are simple static files (OWL2 ontologies in this case seri= alized as both RDF/XML and Turtle).

 

Additionally I have a Tomcat service that I want to = use to silently intercept  requests text/html and application/xhmtl ve= rsions of the resource. 

 

I want the url rewrite/redirect/proxy to be invisibl= e to the caller  (http://example.com/ontology.owl with an Accept: text= /html should go to  http://example.com/parrot/parrot?documentUri=3Dhtt= p://example.com/ontology.owl to generate the proper HTML documentation output but not change the URL as a  RewriteRule do= es, so that the user still thinks the URL is  http://example.com/ontol= ogy.owl

 

Use cases:

 

GET http://example.com/v1/ontology.owl (Accept: appl= ication/rdf+xml)

Returns the /v1/ontology.owl file found in the htdoc= s

 

GET http://example.com/v1/ontology.owl (Accept: text= /turtle)

Returns the /v1/ontology.owl.ttl file found in the h= tdocs

 

GET http://example.com/v1/ontology.owl (Accept: text= /html)

Returns the response from forwarding the request to = a Tomcat webapp running at

http://example.com/parrot/parrot?documentUri=3Dhttp:= //example.com/ontology.owl

 

Additionally, I would like the URL to remain http://= example.com/v1/ontology.owl and  not get rewritten or redirected where= the client sees the webapp service's URL.

 

I currently have the following rewrite rules in plac= e that do most of what I want.

 

RewriteCond %{HTTP_ACCEPT} !application/rdf\+xml= .*(text/html|application/xhtml\+xml)

RewriteCond %{HTTP_ACCEPT} text/html [OR]=

RewriteCond %{HTTP_ACCEPT} application/xhtml\+xm= l

RewriteRule ^/v1/ontology.owl$ http://example.com/pa= rrot/parrot?documentUri=3Dhttp://example.com/v1/ontology.owl [L]=

 

RewriteCond %{HTTP_ACCEPT} application/rdf\+xml<= o:p>

RewriteRule ^/v1/ontology.owl$ /v1/ontology.owl [L]<= o:p>

 

# Rewrite rule to serve RDF/XML content from the voc= abulary URI if requested

RewriteCond %{HTTP_ACCEPT} text/turtle

RewriteRule ^/v1/ontology.owl$ /v1/ontology.owl.ttl = [L,R=3D303]

 

# Choose the default response

# ---------------------------

# Rewrite rule to serve the RDF/XML content from the= vocabulary URI by default

RewriteRule ^/v1/ontology.owl$ /v1/ontology.owl [L]<= o:p>

 

 

How do I set up the config to handle the browser-fri= endly formats as described above?

 

Any help would be appreciated.  I've looked thr= ough the docs and searched the  net, but am at a loss on figuring this= one out.

 

Thank you very much for reading through this massive= wall of text.  I appreciate any help given.

 

/Paul

--------------------------------------------------- Confidentiality Notice:= This electronic mail transmission is confidential, may be privileged and s= hould be read or retained only by the intended recipient. If you have recei= ved this transmission in error, please immediately notify the sender and delete it from your system. --_000_249739F7DF8DBD4D8A082EC507C2D4E5B5CD6690SERV754ARGOLOCA_--