如何在不询问用户的情况下将博主重定向到自定义域?

How to redirect blogger to custom domain without asking user?

我为博客设置了自定义域。

问题:当我访问旧博客 URL 时,Blogger 要求我确认重定向到新域。

我不希望我的读者每次都说 'Yes',最好一次都不要。如何克服这个问题?

我什么都不用做。我所做的就是等待一天。一天因为我第二天检查了它。这可能不是更改生效所需的确切时间。

但是,如果问题没有像我的情况那样自动消失,我想强调上面几条评论中的解决方案(因为有人曾经告诉我很多读者不阅读这里关于 SO 的评论)。

@mehulmpt 的评论

instead of doing it from the settings, maybe in the template you can add: location.href = "http://yoursite.com"; just after

@Prayag Verma 的评论

As the custom domain is not hosted on Blogger, this warning will keep on showing. A much better way would be to unlink the domain from the dashboard & then implement what @mehulmpt suggested. Also, the SE site which would be suited for this question - webapps.stackexchange.com/questions/tagged/blogger