ASP.NET Site Move HTTP to HTTPS, Refresh Google Indexing
When a site is moved from HTTP to HTTPS which is already indexed by Google, we must add a new property for the HTTPS URL in Goolge search console. When Google tries to index the site and it finds HTTP URL indexed for the same page, it will mark the HTTPS pages as canonical. We should use “301 Moved Permanently” to tell Google that HTTP URLs are moved to HTTPS and Google should prefer HTTPS over HTTP. Here is a sample code to be used in an ASP.NET web application for 301 moved status