1

I have a Ubuntu with Apache and PHP running a web server and a full working web site on it. My problem is that recently I also added an API to it and the client fails with 'Error 406'

My website responds with text/xml but it doesnt accept it. According to the developer of the client it must respond with the following headers: application/rss+xml, text/rss+xml, text/xml.

How do I fix/enable this on my server? Any help would be appreciated.

  • Welcome to AskUbuntu! ;-) Could you please give us a bit more information like: what version of Ubuntu you're running? Have you WireSharked the connection between the two yet? – Fabby Jan 30 '15 at 20:16
  • Im using Ubuntu 12.04.1 LTS Server Version: Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.4 with Suhosin-Patch No I did use WireShark – Vlad Jan 30 '15 at 22:33
  • What client? Maybe someone else already has... – Fabby Jan 30 '15 at 22:42
  • The client is nzbdrone and the error mentioned here: forums.sonarr.tv/t/http-status-406-returned-from-indexer/2440 – Vlad Jan 31 '15 at 10:15
  • So the additional API you installed on the server is sabnzbplus? – Fabby Jan 31 '15 at 14:18
1

I found a solution by adding this to htaccess:

<IfModule mod_mime.c>
    AddType text/xml .xml .php
</IfModule>

Not sure why it even works but it does

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.