0

Hi currently im watching my website showing the info if my IP is on whitelist in my webhost if it doesn't, then it wont get the news or load correctly php/JS.

The reason for this happen is the following but idk if some of you have had this before and if is an http request function missing or some protocol of server-sides (common one).

Error from server-side :

[client ip ... ] ModSecurity: Access denied with code 501 (phase 2). Match of "rx ^((?:(?:POS|GE)T|OPTIONS|HEAD))$" against "REQUEST_METHOD" required. [file "/usr/local/apache/conf/modsec2.user.conf"] [line "38"] [id "1234123435"] [msg "Method is not allowed by policy"] [severity "CRITICAL"] [tag "POLICY/METHOD_NOT_ALLOWED"] [hostname "link"] [uri "/showTopNews"] [unique_id "WVukp1ka8AEAChYSbGQAAAAP"] 

1 Answer 1

1

That's a mod_security2 error. More specifically, caused by rule 1234123435

Seems you're violating the REQUEST_METHOD regex. The accepted request types are POST, GET, OPTIONS, HEAD.

You have a few options:

1) fix the request type in your code (use a type that is allowed - open Developer Tools and watch the Newtork tab to see what you're sending)

2) update your rule to allow other types as well (not extremely dangerous if you know what you're adding)

3) You can remove the rule altogether by using this in your apache vhost .conf file (it won't work in .htaccess):

<IfModule mod_security2.c> SecRuleRemoveById 1234123435 </IfModule> 

I'd go with the first one.

The limitation to those 4 request types is fairly reasonable. But it does exclude some types. See HTTP/Methods for more details

Sign up to request clarification or add additional context in comments.

3 Comments

hi thx for the info, the only ways im using for this are ajax type not even post, get, etc just using type: ajax and it denys
hi. "ajax" isn't a method type :) Give this a read SO: What exactly is Ajax request?
nah i didnt mean it is a request type, i just meant that in http type of requesting to my server-side, i'm not using post or get i'm just using ajax(the standart one).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.