using the following code
context.Response.StatusCode = 301; context.Response.Redirect(newUrl, true); context.Response.End();
I can see in fiddler that it's using a 302 instead of a 301. Should I be setting the status after the redirect call?
How to fix it? You should only use 302 redirects where the redirection is temporary and content will come back to the original URL soon. Check the reported URLs. Where the redirection is permanent, change the redirection to 301 (Moved Permanently).
Each redirect serves a different purpose. For a permanent change that will rank for SEO, a 301 redirect is necessary and understood by search engines. 302 redirect should only be used if it is a temporary change, and they often get used because it's easier to create that instance than the permanent 301 redirect.
What is a 302 redirect? Whereas a 301 redirect is a permanent relocation of your URL, a 302 redirect is a temporary change that redirects both users and search engines to the desired new location for a limited amount of time, until the redirect is removed.
A 302 redirect lets search engines know that a website or page has been moved temporarily. When Should You Use 302 Redirects? Use this type of redirect if you want to send users to a new site or page for a short period of time, such as when you're redesigning or updating your website.
If you're using ASP.Net 4.0, you can use Response.RedirectPermanent, which will use 301 instead of 302.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With