Answer the question
In order to leave comments, you need to log in
How is the display of the 404 error page on VK.com implemented?
I will try to formulate the question clearly.
How does VK.com display a 404 error page without a redirect?
It works for them obviously not through htaccess. As far as I understand, first of all, they check through the database whether there is content at such an address. If there is, then we display it, if not, error 404. But when a page with a 404 error is displayed, 8 lines remain from the page code (the same meta tags will not be). How do they "remove" the code of one page while displaying the code of another?
404
Answer the question
In order to leave comments, you need to log in
if rendering is done after receiving the data, then there can be no problems.
and if shit like this
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<?php
$data = $db->get();
// .... вывод
?>
</body>
</html>
You don't need a redirect for this. They just dynamically form and send a page like 404 instead of a regular page.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question