我的网站上有一些页面是纯 HTML 页面,但我想向这些页面添加一些 ASP .NET 类型的功能。我担心的是,如果我简单地将 .html 页面重命名为 .aspx,我会破坏链接,失去 SEO,等等。
我认为对于如何处理这种情况存在“最佳实践”。
最佳答案
在 aspx 上创建您的新页面,并仅从 HTML 页面提供 301 永久重定向。
搜索蜘蛛足够聪明,可以意识到内容已经移动,不会惩罚您。
Google 和 Yahoo 都表示他们会毫不延迟地将元刷新解析为 301 重定向,所以只需执行以下操作即可:
<html>
<head>
<title>Moved to new URL: http://example.com/newurl</title>
<meta http-equiv="refresh" content="0; url=http://example.com/newurl" />
<meta name="robots" content="noindex,follow" />
</head>
<body>
<h1>This page has been moved to http://example.com/newurl</h1>
<p>If your browser doesn't redirect you to the new location please <a href="http://example.com/newurl"><b>click here</b></a>, sorry for the hassles!</p>
</body>
</html>
关于asp.net - 将纯 HTML 页面转换为 ASP .NET aspx 页面的最佳 "process"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/273356/