• Welcome to PHPVIBE Forums. Please log in.

Non-existent pages do not return 404 Not found

Started by Grim,

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

GrimTopic starter

The non-existent pages should have a 404 Not found server response, but they currently return 200 OK.
I googled and tried to add the appropriate command to the 404.php file in theme folder, but got 404 Not found for ALL pages...
I would be very grateful if you could help me with this. Thanks in advance!


I asked this question earlier, but now for some reason I can't find this post.
  •  

Marius P.

Hello!

Was saying before that the 404 layout code is in here https://github.com/PHPVibe/PHPVibe/blob/master/themes/main/404.php

It should trigger  a not-found header

header("Status: 404 Not Found");
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

GrimTopic starter

The problem is that it doesn't work on my site.
You can check, for example, this URL - https://clipz.ru/video/274/bloodywood-gaddaar/
If you just go to it, you will see 404 page.
But if you check this URL with any service, like https://httpstatus.io/, you will see that the server response is 200 OK.
  •  

Marius P.

Try this
header("HTTP/1.0 404 Not Found");

Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  
    The following users thanked this post: Grim

GrimTopic starter

Quote from: Marius P. on Try this
header("HTTP/1.0 404 Not Found");
Looks like it worked, thanks a lot!
  •  

Marius P.

Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •