Tag Info

New answers tagged


Using 404 error codes on the entire site is a terrible practice especially when search engines look at it because it gives them the idea that you're gonna fix missing pages yet your pages you plan to test aren't missing so it makes no sense to convert 200 statuses into 404 statuses. The way you should tackle the problem depends on the level of security you ...


From previous answers I understood that it is a bad practice. Thank you people. But if you need to do exactly what I was asking about: you need just to add to index.php such phrase to the top before any code: <?php header('HTTP/1.1 404 Not Found'); ?> So every page of the site will have 404 status but will stay alive


If this is a test site that shouldn't be indexed at all, there are a couple of steps you can take that tell search engines not to index your site more effectively than returning 404 headers. robots.txt Include a robots.txt at the site's root including: User-agent: * Disallow: / X-Robots-Tag Include the following to your .htaccess to add an X-Robots-Tag ...


This is an XY problem. You want to prevent indexing on your site and you know that 404s are not indexed, so you want to prevent indexing 'using' 404s. This is the wrong way to go. There are many proper ways to prevent indexing such as using robots.txt, meta tags or authentication.

Top 50 recent answers are included