Google webmaster tools refuse to verify a Wordpress blog

Google webmaster tools will not verify a site by the file upload method if it does not return a proper 404 code on missing pages. With Wordpress and permalinks enabled, everything is redirected to index.php, which does exist and unless the PHP code itself overrides the return code, the response would be 200.
The solution is to simply edit headers.php in the theme and add the following to the beginning of the file:
<?php
if (is_404()) { header('HTTP/1.1 404 Not Found'); } ?>

Comments

Popular posts from this blog

ADSL Router Model CT-5367 user and pass (VIVACOM)

Installing Gentoo with full disk encryption

FreeIPA cluster with containers