Website: Walter Gregg

On this page: Main Content. Temporary Cure. Permanent Cure. Explanation.

Lynx Browser? Banish 406 Not Acceptable Errors

April 2016. Are you running the Lynx browser and getting '406 not acceptable' errors? All you need to do to fix this is to change the 'user agent' Lynx sends so that it no longer contains the strings 'lynx' or 'libwww'. There are other things that can cause a 406 error, but this one is easy to fix. Here's how.

Temporary Cure

You're good to go for the rest of your current browsing session. (You might need to press 'r' to reload a page that was previously denied.)

Permanent Cure

You can avoid this trap in the future by starting Lynx with an adjusted user agent per the above, for example by typing: 'lynx -useragent "L_y_n_x/2.8.7dev9.1"'. You can set up an icon and/or batch file to do this automatically.

You can also make Lynx start this way without needing any special argument. To do this, you first have to find lynx.cfg on your system. Then edit it so that it includes, with no leading sharp (#) sign, the line 'ENABLE_LYNXRC:useragent:ON'.

Now, while Lynx is running, press the 'o' key as before. Check the box at the top 'Save options to disk: [x]'. Make the user agent agent change noted above. Save the changes. Now the modified user agent will be saved in a '.lynxrc' file in whatever it thinks your 'home' directory is. It should thereafter start with the modified user agent.

Explanation

Apache mod_security. Lots of people rent Linux server space running 'Apache' software that happens to have this security module. It makes the server run away in terror if it sees a browser header containing any of a long list of strings that are common Linux commands. The point is to make it difficult for malicious visitors to actually run one of those commands. The forbidden strings include 'lynx'. Some also ban 'libwww' which is used by some unwelcome robots. So we substitute 'l_y_n_x' for 'lynx' and remove the unnecessary libwww bit. We can remove the ssl bit too, because there is no need to include it.

The parenthetical phrase (iPhone; U; PC like Mobile; en) tells websites you would like to see the leaner mobile version of their site, if they have one. Some sites trigger on 'iPhone', but only immediately after the parenthesis and with a delimiter at the end. Some trigger on 'Mobile'. The 'U' is a traditional indicator of strong encryption and the 'en' indicates the language the browser controls use. They probably have no value but they do no harm.


, Lynx Browser? Banish 406 Not Acceptable Errors (Apr. 2016) (available at ). © W. Gregg 2016; CreativeCommons.org /licenses /by-nc-sa/4.0.

 No Privacy