httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Galić <i.ga...@brainsware.org>
Subject Re: [users@httpd] Change MIME-type in Apache 2.2 on depence of full get-query (with characters after "?")
Date Fri, 03 Dec 2010 11:38:38 GMT

----- "Сергей Реймеров" <sergeyreym@gmail.com> wrote:

> Good time of the day. I spent a lot of time and decided to ask my
> question on the mailing list.
> So, there is a program 1C Enterprize that has an Apache module and
> generates some http-responses by urls like this:
> http://localhost/InfoBase/RU_ru/e1cib/files?url=e1cib/data/A.B.C.D?ref="b61b0800279350f811dff07922b6bcc0"&targetFileName=file.html
> 
> This http-response have mime-type: application/octet-stream and
> Content-Disposition: attachment. Thus a file is downloaded rather
> than
> displayed in the browser.
> 
> But I want to change http-response (via Apache modules or tools) by
> some url condition. Seemingly ideal for this
> LocationMatch+mod_headers. E.g.:
> <LocationMatch "targetFileName=[a-z]+.html">
>   Header set Content-Type "text/html; charset=utf-8"
>   Header unset Content-Disposition
> </LocationMatch>
> 
> But, LocationMatch works only with get-query without query part after
> symbol "?". E.g. it accepts only
> "http://localhost/InfoBase/RU_ru/e1cib/files" in example URL.
> 
> I have no ideas to do this but feeling that this can be solved.

In vhost context, match what you want to match with RewriteCond.

With:
http://httpd.apache.org/docs/trunk/rewrite/flags.html#flag_t

set Content-Type to "text/html; charset=utf-8"

and set an env like: remove_contentdisposition=1
http://httpd.apache.org/docs/trunk/rewrite/flags.html#flag_e

Then, remove content disposition, based on that en
http://httpd.apache.org/docs/current/mod/mod_headers.html#header

Header unset Content-Disposition env=remove_contentdisposition

Alternatively, you can also set the content-type with Header and
your env=mangle_contentstuff


> Thank you for you attention.

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message