[英]Next.js loads homepage instead of the 404 page
我有一个带有自定义 404 页面的 Next.js 应用程序。 这是我的网站:frinksmovement.com 当我转到未定义的子域(例如 frinksmovement.com/abc)时,它应该显示自定义 404 页面,但它会加载我的主页。 这不会发生在我的本地机器上。 这是我的 next.config.js:
module.exports = {
webpack: (config) => {
config.module.rules.push({
test: /\.(graphql|gql)$/,
exclude: /node_modules/,
use: {
loader: "graphql-tag/loader",
},
});
return config;
},
async redirects() {
return [
{
source: "/gornation",
destination: "https://www.gornation.com/?ref=0j-iwl-pbxrv",
permanent: true,
},
];
},
trailingSlash: true,
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.