Fixing a 400 Bad Request

Need a little help fixing a 400 Bad Request? Most technicians will tell you to try clearing cache and cookie in one of the free Internet browsers that you have installed and from my experience, that is the first thing that you would have tried so I always give the advice of changing the ports info in the URL of the browser to port 80 and if the server that you are connecting to has a valid SSL certificate, to use HTTPS (port 443) over HTTP (port 80).

Bad Request

Your browser sent a request that this server could not understand.
Reason: You’re speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.

Additionally, a 400 Bad Request error was encountered while trying to use an ErrorDocument to handle the request.

Original With Error: http://www.stephanpringle.com:443/fixing-a-400-bad-request/
HTTPS scheme: https://www.stephanpringle.com:443/fixing-a-400-bad-request/
HTTP scheme: http://www.stephanpringle.com:80/fixing-a-400-bad-request/

Website Visitor
I find that computer users do not want to kill off their cookies as the cookies are being used to store usernames and passwords for their online accounts and it will be a task to try to recover that information. If you want to determine if the cookies or the cache is causing the 400 Bad Request issue or not, use the “incognito” function of the browser to load the page. If the error persists (as cookies are not transferred to your incognito session, then the issue is in on the server and not your device. To verify, use one of the alternate free Internet browsers and see if the issue continues. Hopefully, the site supports multiple browsers and not only the one that came installed on the computer.

Copy the full URL and visit archive.org and have it look up the link. If you see it has not been archived in a while, it means the page has moved so if it was a link from an external site ignore it going forward. If the archive is recent, it may be down for maintenance, high traffic or the webmaster goofed up while editing an .htaccess file.

Website Owner or Server Owner
If the website belongs to you and is giving the error message, the first thing you need to do is check the .htaccess file on the root of the server then subfolders or subdomain. Before editing an .htaccess file, it is important to make a local backup copy and pay attention to any lines mentioning ErrorDocument 403 or ErrorDocument 404. This blog use to have index.html as my homepage and I targeted 403 and 404 errors to this page. When I moved to PHP and had index.php as the homepage, I failed to update the .htaccess file and this caused ErrorDocument warnings I posted above and doubled as I started using SSL certificates. To reduce that from happening for sites I manage going forward, I enable a clean home page URL by editing an .htaccess file and hasn’t had an issue since 2003.

The following two tabs change content below.
facebook-profile-picture

Stephan Pringle

Technology Support Specialist at Sipylus
About The Author: Stephan Pringle is an Information Technology Support Specialist. He covers hardware and software and provides tips for you to troubleshoot and repair issues on your own. In his spare time, he writes articles about the State of New York on his Hackintosh and HackBook and that has helped him to become the top contributor of the New York City section of Yahoo! Answers.
facebook-profile-picture

Latest posts by Stephan Pringle (see all)

facebook-profile-picture

Stephan Pringle

About The Author: Stephan Pringle is an Information Technology Support Specialist. He covers hardware and software and provides tips for you to troubleshoot and repair issues on your own. In his spare time, he writes articles about the State of New York on his Hackintosh and HackBook and that has helped him to become the top contributor of the New York City section of Yahoo! Answers.