how to add cannonical tag for ASPX .NET page
Ad
How could I set a cannonical tag for .NET (aspx) web pages that use master pages?
based on the SEO test, our site fails on the canonical test. we are using a 3rd party hoster (win server) and don't have access to root server!
I added the following snippet to my domain.com/default.aspx page
HtmlLink seoTag = new HtmlLink();
seoTag.Attributes.Add("rel", "canonical");
seoTag.Href = "http://www.domain.com/";
Header.Controls.Add(seoTag);
but that didn't help!
Appreciate your feedback.
Ad
Answer
Ad
Try to add this in the aspx (html code)
<link rel=”canonical” href=”http://example.com/page.html”/>
Ad
source: stackoverflow.com
Related Questions
Ad
- → Function Undefined in Axios promise
- → React formatting dates with momentjs server side
- → AngularJS directive: "templateUrl" doesn't work while "template" works
- → how to add cannonical tag for ASPX .NET page
- → JavaScript in MVC 5 not being read?
- → URL routing requires /Home/Page?page=1 instead of /Home/Page/1
- → ASP.NET routing w/ changing article name
- → NumericTextBox Loses Value using Html.TextBoxFor, not HTML
- → How to do Bundling of css & js files in Drupal
- → Does the fact that every page is reachable through www.example.com and www.example.com/index have any SEO impact?
- → How to add rich snippet in a website?
- → UrlRewriting does not work on server, but on localhost it works fine on asp.net?
- → Bootstrap Nav Collapse via Data Attributes Not Working
Ad