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
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"))

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.