Go Back   DaemonForums > Miscellaneous > General software and network

General software and network General OS-independent software and network questions, X11, MTA, routing, etc.

Thread Tools Display Modes
  #1   (View Single Post)  
Old 2nd December 2008
Malakim Malakim is offline
Real Name: Markus Svensson
Port Guard
Join Date: May 2008
Location: Eslöv, Sweden
Posts: 13
Default Apache: problem with rewritten content-type header


I'm sure there are some real Apache geniuses here, so maybe you can give me some advice.

I have the following problem:

* I have an Apache 2.2.10 server fronting a web application running on Tomcat 4.0.5 via ProxyPass directives.
* When I send a request to my web app directly at the Tomcat server it responds with content-type=application/xhtml+xml, which is what I want.
* If I send the request to the Apache server it responds with content-type=text/html.

Is there any way to configure Apache to respond with the corerct content type?


Reply With Quote
  #2   (View Single Post)  
Old 3rd December 2008
DNAeon DNAeon is offline
Shell Scout
Join Date: Sep 2008
Location: Bulgaria
Posts: 138

I'm not sure if this is what you are looking for, but anyway..

RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml
RewriteCond %{HTTP_ACCEPT} !application/xhtml\+xml\s*;\s*q=0
RewriteCond %{REQUEST_URI} \.html$
RewriteCond %{THE_REQUEST} HTTP/1\.1
RewriteRule .* - [T=application/xhtml+xml]
Additional info could be found in the links below:

Also, you may want to have a look at the DefaultType directive in the httpd.conf file. Check out mime.types too.

Good luck!
"I never think of the future. It comes soon enough." - A.E

Useful links: FreeBSD Handbook | FreeBSD Developer's Handbook | The Porter's Handbook | PF User's Guide | unix-heaven.org
Reply With Quote
  #3   (View Single Post)  
Old 3rd December 2008
Malakim Malakim is offline
Real Name: Markus Svensson
Port Guard
Join Date: May 2008
Location: Eslöv, Sweden
Posts: 13


I've considered the RewriteConds - but I don't quite understand how to use them for a proxypassed URL. I guess I'll have to read up on that.

I've checked mime.types, and I think that they are set correctly - but I'll double check that. Also, I thought that mime.types only worked based on file extensions? The service I have does not serve "files", so the URL's have not file extension - for example

I'll check out DefaultType as well, I wasn't even aware that it existed.

Thank you for the pointers!
Reply With Quote

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Big5 Character Set in Apache problem after upgrade to 6.4 paul-lkw FreeBSD Installation and Upgrading 0 23rd February 2009 09:20 AM
(Net|Open)BSD Make: implicit C header dependencies taylor_venable Programming 3 25th November 2008 10:32 AM
Problem with php and apache on OpenBSD co_bofh OpenBSD General 10 27th July 2008 10:13 PM
Apache Problem ( Permission ) dctr FreeBSD General 8 27th May 2008 09:48 PM
apache fd size problem oxy FreeBSD Ports and Packages 0 10th May 2008 10:49 AM

All times are GMT. The time now is 06:45 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick