cheetahes Posted October 24, 2011 Share Posted October 24, 2011 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! (: Quote Link to comment https://forums.phpfreaks.com/topic/249707-special-characters-in-get-406-error/ Share on other sites More sharing options...
Psycho Posted October 24, 2011 Share Posted October 24, 2011 use urlencode() for the names and values that you append to the URL and then use urldecode() when you access them Quote Link to comment https://forums.phpfreaks.com/topic/249707-special-characters-in-get-406-error/#findComment-1281795 Share on other sites More sharing options...
requinix Posted October 24, 2011 Share Posted October 24, 2011 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")) Quote Link to comment https://forums.phpfreaks.com/topic/249707-special-characters-in-get-406-error/#findComment-1281839 Share on other sites More sharing options...
cheetahes Posted October 25, 2011 Author Share Posted October 25, 2011 Hmm, Unfortunately, that didn't seem to change anything. I've contacted my server-thing. It seems like they've just changed host. Maybe they can fix it with some config thing. If not. Then I'll come back here for more help!(: Quote Link to comment https://forums.phpfreaks.com/topic/249707-special-characters-in-get-406-error/#findComment-1282046 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.