8

Fix 5xx server validation errors in Google Search Console for Gatsby

 2 years ago
source link: https://markshust.com/2019/01/31/fix-5xx-server-validation-errors-google-search-console-gatsby/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Fix 5xx server validation errors in Google Search Console for Gatsby

January 31, 2019   ·   2 min read  ·   Edit on GitHub

Today I woke up to a new email sitting in my inbox saying “New Coverage issue detected for site http://markshust.com/:

Coverage email

Clicking the “Fix Coverage Issues” button, I was sent into Google Search Console (you are using Google Search Console, right? It tells you all sorts of good and bad things happening with your web site). I then noticed that the comment and newsletter URLs from my old Drupal blog were being returned as 404/500 server errors:

Console errors

The easiest solution would be to just add some lines to a netlify.toml file. This file controls all sorts of server settings and configurations you would typically see in a server configuration file. I find it much more flexible than using a _redirects file.

I had a few entries there, so just added a few more.

netlify.toml
[[redirects]]
  from = "/blogs/markoshust"
  to = "/"
  status = 301
  force = true
[[redirects]]  from = "/comment/*"  to = "/"  status = 301  force = true[[redirects]]  from = "/newsletter/subscribe-marks-newsletter"  to = "/"  status = 301  force = true[[redirects]]
  from = "https://markshust-com.netlify.com/*"
  to = "https://markshust.com/:splat"
  status = 301
  force = true
[[redirects]]
  from = "https://markshust-com.netlify.com/"
  to = "https://markshust.com/"
  status = 301
  force = true

After pushing up and deploying, I just clicked the Validation Fixed button in Google Search Console, and now the validation errors will correct themself on the next batch check.

Are you a Magento geek?

Signup for my newsletter and I'll let you know about Magento-related blogs, courses & more.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK