所以我有我的域 - www.mycatchyname.com,它基本上是一个有一个目的的单页站点,所以我在根 Controller /操作上使用 RedirectToRoute 直接转到 www.mycatchyname.com/seo -关键词。所以 www.mycatchyname.com/seo-keyword 基本上就是主页。
Google 如何看待这一点?搜索我的网站实际内容的人可能会在结果中选择 www.mycatchyname.com/seo-keyword,但是有些人会直接访问 www.mycatchyname.com。这两个实例都会被索引并在结果页面上有单独的 pageranks/条目吗? RedirectToRoute 是一种什么样的重定向?
除了直接拥有 www.seo-keyword.com 之外,是否有更好的方法来完成我正在尝试做的事情,因为那不是一种选择。
最佳答案
我相信 301 重定向在 SEO 方面对于您尝试做的事情会更好。这是您可以创建永久重定向操作结果的一种方法:
public class PermRedirectResult : ActionResult
{
private string _url;
public PermRedirectResult(string url)
{
_url = url;
}
public override void ExecuteResult(ControllerContext context)
{
context.HttpContext.Response.RedirectPermanent(_url, true);
}
}
然后你可以像这样在你的 Controller 中调用它:
public ActionResult Index()
{
return new PermRedirectResult("www.mycatchyname.com/seo-keyword");
}
希望对你有帮助。
关于asp.net-mvc - RedirectToRoute 如何影响 SEO?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3263778/