sllkevin's avatar

Is it normal for 404.blade to respond as 301?

When using the browser network tools, I can see that any missing route originally reveals 404 before the official response as a 301 redirect to the 404.blade template.

However, I'm checking my Nginx access logs and all the bots pinging random wordpress routes all show the response as 301. Is this normal behavior?

0 likes
4 replies
jlrdw's avatar

I don't why it would try a redirect, yes check your Nginx logs. There is somehow a redirect somewhere.

Edit:

Probably just how Laravel is redirecting to the 404 page.

sllkevin's avatar

That's my thinking, but shouldn't bots and crawlers or curl pings receive a proper 404 response? I just checked the standard Laravel 404 (dark 404 | NOT FOUND page) and the response is 404 in dev tools. But my custom 404.blade is 301.

martinbean's avatar

@sllkevin No, it’s not normal. Is there some sort of canonical redirect going on, e.g. www to non-www, HTTP-to-HTTPS, etc?

Please or to participate in this conversation.