Jump to content

Special characters in GET - 406 error


cheetahes

Recommended Posts

Hello,

 

On my site, I use a lot of $_GET[''] - It has worked fine for months. But now suddenly, every time a "%" appears in the get line, ex:

?tvshow=[kanal4]_danmarks_n%E6ste_topmodel

(really means ?tvshow=[kanal4]_danmarks_næste_topmodel)

 

- And when that happens, I get a "406 Not Acceptable" error. I'm not sure why, since this has never happened to me before.

Not Acceptable

An appropriate representation of the requested resource /tv_shows_select_season.php could not be found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Anyone know how I can fix this?

 

Thanks in advance! (:

 

 

Link to comment
https://forums.phpfreaks.com/topic/249707-special-characters-in-get-406-error/
Share on other sites

The source of the error message is Apache's mod_security module. URLs are supposed to be in UTF-8 encoding and %E6 is an invalid UTF-8 character so mod_security rejects the request with a 406 error.

 

Use urlencode() as mjdamato said, but right after using utf8_encode().

urlencode(utf8_encode("[kanal4]_danmarks_næste_topmodel"))

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.