There Was a Problem With Your Action Please Try Again or Reload the Page Modsecurity

Regardless of what may be causing them, server errors are without doubt frustrating both for users visiting your website and for yous as the website owner. While some HTTP errors are more common than others, it's ever good to be prepared for any error that your web server may throw at you. Luckily, HTTP Error 406 Not Adequate is non as common as 404, 500 or 301 HTTP codes are, but you may encounter it nonetheless, and when yous exercise, the cause is usually i of the following two: a content type negotiation problem or misunderstanding or a mod_security rule setting trouble, the latter being the about mutual of the 2.

This article sheds light on why a server returns a HTTP error 406 Not Acceptable and what can you do to fix the underlying problem.

HTTP Mistake 406 Caused past an Accept Header Problem

When a client (web browser) wants to load a webpage, first it needs to obtain the IP address of the server. To this end, it does a DNS lookup, which translates the domain.com to an IP accost. The DNS might render multiple IP addresses; in that example, it will pick the first one and establish a TCP Socket connectedness to port 80 or 443 to that IP accost. Upon a successful connectedness, information technology will write the HTTP request data (e.g. Become /  HTTP/1.1, Host: domain.com, Accept: text/html, User-Agent: Mozilla …).

error 406 not acceptable example

The server, later on it receives a request, depending on the Accept header, it might render a 406 condition lawmaking indicating that it cannot send the data in any of the formats mentioned in the client's Have header. This rarely happens in real life because near web browsers will accept anything signaled by */* in the Have header of the request. This is a final resort endeavor, the clients usually signal what content blazon they want to receive, and they define a priority list, */* united states usually with the lowest priority (q=0.5). For example, the client sends the request considering in that location is an img tag in the html, it will point information technology to the server that it's expecting an prototype in the first place. Accept headers can have diverse types (have-encoding, accept-charset, accept-ranges, accept-language, etc.), specifying the characteristics of the data they accept. For instance, a web browser may be able to process only HTML or GIF files, so if the web server would not be able to return information in whatever of these formats "understood" past the client, it will display a 406 Not Adequate error code.

The opposite can too happen: if a web server doesn't know the request extension, information technology may search for another application installed on it to run into if that would exist able to serve the file. If at that place isn't whatever other awarding that tin can serve the file, it volition return a 406 Not Adequate error. The server too will return a 406 when it is not certain about the MIME type of the requested file. This tin be quite useful as it might prevent leaking of sensitive information usually kept in exotic file extensions like .ini, .kdb, .laissez passer, etc.

How to Fix It?

Given that a 406 status lawmaking tin be a content type negotiation mismatch event, y'all need to implement certain changes so that the server has a MIME type associated with the request extension.

If you are running an IIS based spider web server, y'all need to make sure that the IIS recognises your extensions. You can add new extension to IIS simply by editing the MIME types. You lot can add for example *.less  and gear up its MIME type to text/css. This is the most straightforward solution to a 406 Not Acceptable HTTP error returned by the server. If you are running Apache every bit your webserver, you can add MIME types in the .htaccess file or your VirtualHost configuration. An example for the .less file would exist "AddType text/css .less ".

Alternatively, y'all can make changes in the Have header of your browser then it knows the MIME type handled by your server. Making changes to the Take header can also help, nevertheless, it's a less viable solution than changes made on the server side.

HTTP Error 406 Caused by a mod_security Rule Setting Problem

The other scenario in which you may be met with a 406 status code is when a mod_security rule is enabled on an Apache server. It'due south a type of web awarding firewall (WAF) program enabled by default on the hosting accounts of some web hosting providers. For example, InMotion Hosting has mod_security enabled on all their Apache based hosting accounts to protect spider web applications from common attacks similar XSS or SQL Injections, as these types of security holes can easily creep into web applications. The mod_security continuously scans the server and the incoming request and the outgoing response for violations of rules it has prepare. If an activeness that violates the rules prepare in the mod_security occurs (a violation caused past a site, folio or function), the server will transport a 406 Not Acceptable error.

How to Fix It?

Disabling mod_security for each of your domains individually or disabling certain rules in Mod_security will help set the error. If your hosting account comes with cPanel, the easiest way to turn off mod_security is via the modsec Manager plugin. Alternatively, you tin can use command line in SSH. If yous want to disable specific rules or your hosting account does non come with the choice to disable/enable mod_security, y'all need to get in touch with your web hosts' client back up team to exercise it for yous.

Conclusion

Albeit an infrequent HTTP error, a 406 Not Acceptable error can make an advent hither and in that location, and when it does happen, it'southward most probably acquired by a mod_security rule setting problem rather than an Accept header trouble. If you're not comfortable dealing with this upshot alone, don't hesitate to contact the web hosting company your website is hosted at as they tin can hands get to the root of the problem and set the error for you lot.

wernerchember.blogspot.com

Source: https://webhostingmedia.net/http-error-406-not-acceptable/

0 Response to "There Was a Problem With Your Action Please Try Again or Reload the Page Modsecurity"

Postar um comentário

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel