Why am I seeing so many 403 errors for .php/ requests in my logs?

0
4
Asked By CleverCookie99 On

I've noticed a surge in 403 errors in my server logs, particularly for requests ending with `foo.php/` (including the trailing slash). Most of these requests seem to come from bots, but there are a few from genuine users too. I've already reviewed several Apache configuration files but haven't figured out the source of this issue yet. It's possible that something going on with Cloudflare might be causing it. Would it be a bad idea to implement a 301 redirect for all requests with `.php/` to just `.php`? My reasoning is that this could fix the issue for legitimate users, but I'm concerned it might also increase traffic from the bots.

4 Answers

Answered By QuantumQuokka On

You should stick to a consistent pattern for your URIs to avoid SEO and caching issues. Ideally, paths that lead to directories have a trailing slash, but with modern web setups, it's often unnecessary. So having `.php/` in the URL structure just seems incorrect.

Answered By JavaJuggler23 On

Be cautious about using a 301 redirect. While it might fix the issue for real users, it could also double your bot traffic since they’ll just hit a new endpoint. You may want to investigate further to see how often legit users are hitting these URLs. If it's rare, leaving the 403 might be better, and focusing on the root cause could save you future headaches.

Answered By CreativeCactus On

If there are legitimate users asking for these URLs, check your application's code for any mistakes that might be appending the trailing slash. On the other hand, if it’s just bots, letting them hit a 403 is fine; they aren’t worth the trouble!

Answered By SillySalamander On

I’d question the visibility of `.php` in your URLs altogether. I don't know too many PHP developers who let `.php` show up. Consider blocking those requests at the Cloudflare level since they usually come from bots.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.