How does RedirectToRoute affect SEO?

So, I have my domain - www.mycatchyname.com and its website on one page, which has one purpose, so I used RedirectToRoute on the root controller / action to go directly to www.mycatchyname.com/seo -keyword. So, www.mycatchyname.com/seo-keyword is basically a homepage.

How does Google see this? People who are looking for what is actually connected to my site are likely to pick up www.mycatchyname.com/seo-keyword in the results, however some people will be directly on www.mycatchyname.com. Will both instances and individual pages / entries on the results page be indexed? What is RedirectToRoute redirection?

Is there a better way to do what I'm trying to do, besides the fact that you have a website www.seo-keyword.com, because this is not an option.

+4
source share
3 answers

I believe a 301 redirect would be better in terms of SEO for what you are trying to do. Here you can create a permanent result of the redirect action:

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); } } 

Then you can call it in your controller as follows:

 public ActionResult Index() { return new PermRedirectResult("www.mycatchyname.com/seo-keyword"); } 

Hope this helps you.

+1
source

This can be a problem for your SEO.

ASP.Net MVC uses 302 whenever you return RedirectToRouteResult or RedirectResult. This means that your new page cannot be indexed.

  • 301 means permanent redirection (as in: forget old page and url)
  • 302 means temporary redirect (as in: index of source URL, but with target URL information)

So, use 301 redirects on the main page if you do not want this indexed.

Also: since you create 2 URLs with the same content, you create duplicate content . Having one URL for each page is pretty important (see the canonical URL meta tag ).

+1
source

In this instance, ASP.NET uses 302 redirection (temporary redirection). You might be better off using 301 (persistent redirects), but you will have to create your own ActionResult and return it from your action method.

0
source

Source: https://habr.com/ru/post/1315894/


All Articles