Take the 2-minute tour ×

All of the following lead to the same homepage of my site:


the same .cshtml file will also render other variations, e.g (the number on the end is the page number)


im setting it in the view using something like : ViewBag.CanonicalLink = "http://www.exmple.com/";


now im trying to create a canonical link within the cshtml file, but puzzled with how to set it correctly for SEO? any ideas?

share|improve this question
add comment

1 Answer

You should decide on a single canonical URL and then add <link rel="canonical" href="..."> to the head.

share|improve this answer
the main link i want is "mysite.com/"; but given that this page also renders for something like "mysite.com/news/month/images/3"; then that wouldnt be apropriate to set it for that –  raklos Feb 20 '11 at 14:06
@raklos: You should set the canonical URL to the URL you want to remain primary. (and make sure that it's not a temporary url - make sure it won't change) –  SLaks Feb 20 '11 at 14:09
add comment

Your Answer


