简体   繁体   中英

403- Forbidden for file in PHP for some request

My PHP page script is responding with 403-Access forbidden for some http requests while for some requests its responding properly.

For the below request (By ajax) I'm getting 403-Access forbidden

 POST http://xxxx./xxx/xxx/xxx/xxxx/interaction/practitioner HTTP/1.1 Host: xxxx Connection: keep-alive Content-Length: 2520 Accept: */* Origin: http://xxx X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.267 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Referer: http://xxxx./xxx/xxx/xxx/xxxx/index.php X-Citrio-Timestamp: Wht/CLSj01IhGLSPNfWemGXwGww= 2016-02-12T17:41:39.961Z Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.8 Cookie: PHPSESSID=c83cae9c3bc88a4b8ff7ea3c3b279a22 {JSON DATA} 


But, another request to same page is responding properly with different JSON DATA.

Means, for a particular data its giving 403-access forbidden and for some data its responding properly.

The php scripts contains 10-20 functions but, both requests are calling the same function.. {Register user with timetable ids.}

Not really a tech answer, but I asked the providers of our shared multi-site reseller hosting if a ModSec rule could be the cause of this, ie inconsistent blocking of an ajax POST with a 403 being returned on fail. They (NetHosted: brilliant support, always) had a look at their end and then disabled a couple of ModSec rules they could see were being triggered. That was the fix.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM