Using ‘curl’ on page returns 406 Not Acceptable [resolved]
Came across an issue where trying to curl a page to see the result would return a "406 Not Acceptable answer":
# curl http://domain.com/curl.php <html><head> <title>406 Not Acceptable</title> </head><body> <h1>Not Acceptable</h1> <p>An appropriate representation of the requested resource /curl.php could not be found on this server.</p> <p>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.</p> </body></html>
I found faking the User agent to Firefox or Mozilla has fixed the issue and gave me the result I wanted:
# curl http://domain.com/curl.php -A "Mozilla" Curl worked!