在https://developers.google.com/speed/pagespeed/insights中,由于上述错误,我的速度确实延迟了。
我试图通过将软件包添加到gatsby-config.js来解决该问题,但是它不起作用。在我的site-config.js siteUrl中:https://mysite.co
。我该怎么解决?
{
resolve: 'gatsby-plugin-htaccess',
options: {
RewriteBase: '/custom/',
https: true,
SymLinksIfOwnerMatch: true,
host: 'mysite.co',
redirect: [
'RewriteRule ^not-existing-url/?$ /existing-url [R=301,L,NE]',
{
from: 'http:mysite.co',
to: 'https:mysite.co',
},
],
},
},
答案 0 :(得分:0)
需要添加 https
gatsby-config.js
module.exports = {
siteMetadata: {
siteUrl: `https:mysite.co`
},