Search code examples
node.jsgoogle-app-enginegoogle-search-console

Google Site Verification Failure - HTML File Upload method


I have an Express/NodeJS app running on Google App Engine, for which I have the URL in the format of: project-name.appspot.com, where project-name: My google project name

Now, for site verification, I am using HTML File Upload method.

I am serving the html verification file provided by google as follows:

    res.sendFile(path.join(__dirname, path_to_html_file))

Now, when I enter the url: https://project-name.appspot.com/, I can view the file. Also, the file has the same name as provided by Google.

However, when I click Verify in Webmaster, it still fails with error message "File not Found"

Can anyone point what I might be doing incorrectly ?


Solution

  • You need to serve this file from the /xxxxx.html url, not the root url. In other words, it needs to be accessed from https://project-name.appspot.com/xxxxxxxx.html

    Think about it... This file must stay up for as long as you want to be verified, so it doesn't make sense to be shown at the root url.

    Also, make sure there are no redirects in serving this file.