Recently, I faced an issue with one of my website – Infopixi. Google Webmaster was unable to verify this domain because the home page was returning ‘404 (Not Found)’ instead of ‘200 (OK)’. The page definitely was there and opening correctly in all platforms, when I checked with Responsinator.
I also cross-checked this with HTTP/HTTPs header checking tools, the homepage was really giving the 404, other pages (internal pages, blogs, category pages etc.) were returning 200.
I searched online for the solution and raised the question on WordPress Forum, but got no substantial solution. I checked the .htaccess file, permalink settings, file permissions and made the changes accordingly but nothing happened.
(Make sure to backup your .htaccess file before making any changes to it.)
What the heck was the problem? I was confused and didn’t know what to do.
How I fixed the problem?
Take a look at the response code returned by the Home Page.
HTTP/1.1 404 Not Found =>
Date => Tue, 14 Jun 2016 05:16:03 GMT
Server => Apache/2.4.16
X-Powered-By => PHP/5.4.43
Expires => Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control => no-cache, must-revalidate, max-age=0
Pragma => no-cache
Link => ; rel=”https://api.w.org/”, ; rel=shortlink
Vary => Accept-Encoding,User-Agent
Connection => close
Content-Type => text/html; charset=UTF-8
Look at this line:
Cache-Control => no-cache, must-revalidate, max-age=0
Cache-Control specifies the directives (the manners in which a page is to be cached) that must be obeyed by all caching mechanisms. The “no-cache” directive is specifying that the cache needs successful revalidation from the origin server.
The “max-age” response directive indicates that the response is to be considered stale after its age is greater than the specified number of seconds, in this case, it is zero seconds.
Simply put, Caching is a feature that optimizes your website and improves performance. Sometimes, it might create problems and need to be cleared.
So, I installed a plugin named WP Total Cache to enable caching and empty all the existing cache for the changes to take effects.
Then, I checked the home page header response code. And It worked!! Now the homepage is returning 200 (OK) status code instead of a 404. Google has also verified the ownership in Search Console.
Do you think there is another way of fixing this problem? What is that? I would love to know in comments.