1

In my .htaccess file I use a simple redirect rule.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule SMS SMS.php [L,QSA]
</IfModule>

This works for a simple request with a HTTP-header like

Accept: text/html,*/*
Accept-language: en

But for requests with a header with another Accept-header like

Accept: bla/bla
Accept-language: en

I get a HTTP/1.1 406 Not Acceptable error.

I can get it to work, adding this to my .htaccess file

<Files *>
ForceType bla/bla
</Files>

But I'm searching for a solution that accepts any Accept-header currently I need to know the exact spelling, something like this fails

ForceType */*

Btw. When I access the page directly (http://example.com/SMS.php) without the rewrite rule it works, independent of the access-header.

jeb
  • 78,592
  • 17
  • 171
  • 225
  • 1
    The server sends a 406 error when it detects that it cannot send back any type the client requests from the server. You should not return a data stream with a different mime type that the client cannot (or doesn't want to) receive. – Sumurai8 Aug 21 '14 at 20:16
  • @Sumurai8 I know this, but currently I need to redirect in any case. But thanks anyway – jeb Aug 21 '14 at 20:22
  • 1
    Possibly related? http://stackoverflow.com/questions/19169337/apache-2-multiviews-and-406-error-for-image-request – Sumurai8 Aug 21 '14 at 20:40
  • @Sumurai8 Thanks, didn't know `MultiviewsMatch Any`, but sadly it doesn't work – jeb Aug 21 '14 at 21:21

0 Answers0