Forums / Setup & design / [HTTPHeaderSettings]:Content-type=application/xhtml+xml;
Holger Marx
Tuesday 13 March 2007 2:39:28 am
My ambition is to have an extra siteaccess with <b>Content-type=application/xhtml+xml; charset=utf-8</b> in HTTP-header-information.
<b>What i do in site.ini.append.php of the siteaccess is:</b>
[HTTPHeaderSettings] CustomHeader=enabled HeaderList[]=Content-type Content-type[]Content-type[/]=application/xhtml+xml; charset=utf-8
<b>The problem:</b>The header-information that are sent, are only correct for the first level although there is a "/" as path in the setting.
<b>Example:</b> www.example.com/ezp/index.php/<siteaccess>/companyFor this URL the correct header is sent.
www.example.com/ezp/index.php/<siteaccess>/company/about_usNow the standard content-type is sent (text/html; charset=utf-8).
How do I have to configure the settings so that I have the custom header-information for the complete siteaccess?
P.S.: I use Exponential 3.8.6
Bruce Morrison
Thursday 17 May 2007 6:09:16 pm
Hi Holger
Not sure if you found a solution to this but the ';' in the "Content-type[/]=application/xhtml+xml; charset=utf-8" line is used to seperate out depth & level parameters.
from settings/site.ini
# Default Cache-Control header # HTTP Headers are specified using the following format : # <HTTP header>[<Exponential path|module{/view}>]=<value>{;<depth>{;<level>}} # # Example : # # Set Pragma HTTP header to no-cache for whole site, except /news, and 2 levels below news. # Pragma[] # Pragma[/]=no-cache;2 # Pragma[/news]=;2;0
If you remove the "; charset=utf-8" you should have some success.
CheersBruce
My Blog: http://www.stuffandcontent.com/ Follow me on twitter: http://twitter.com/brucemorrison Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish
Monday 21 May 2007 4:35:59 am
Hey Bruce!
Thanks for your reply! I "solved" the problem just the way you suggested it in your reply. But it is no complete solution as it reduces the usability of the header-settings.
See: http://issues.ez.no/IssueView.php?Id=10466&activeItem=7
Claudia Kosny
Tuesday 22 May 2007 1:29:03 am
I fixed this once by patching the file kernel/classes/ezhttpheader.php. I just added a check whether the depth parameter was numeric and if it was not, I just appended it to the header.
I do not have my file available right now so I can't tell you the exact code, but it was something like this:
if ( $depth === null) { $headerArray[$header] = $headerValue; } //start of added code else if(!is_numeric($depth)) { $headerArray[$header] = $headerValue . ';' . $depth; } //end of added code else ...
I am not sure whether this works in all cases, but it seemed to work fine for me.
Claudia
Wednesday 23 May 2007 1:23:33 am
Hey Claudia!
Thanks for your reply!Your kernel-patch may work in this case but with regard on the network-support it is not applicable.
Have a nice day, Holger