I'm Keyvan Nayyeri, a 25 years old Ph.D. student at
the Computer Science department of
the University of Texas at San Antonio.
I'm also
a Software Architect and Developer and previously held a B.Sc.
degree in Applied Mathematics.
This is my blog where I publish content about various topics specifically Programming Languages and Compilers, Software
Engineering and Programming.
As I don't want to register my personal website domain (KeyvanNayyeri.Com) for next year today redirected it to Nayyeri.NET to move my links popularity and PageRank to here.
Bellow this post I've posted about the code I used to implement 301 redirect in ASP.NET as a SEO friendly redirection:
First created a page with this code then set it as my customError page in Web.Config so all incoming requests are redirecting to Nayyeri.NET with 301 redirect.
P.S. Note that my domain will expire in next 3 months so my email addresses on KeyvanNayyeri.Com will not be valid in the future.
Here is my description about the code I've used:
Sometimes you need to move users from a website to another. There are two choices available: 301 and 302 redirects. Here I'm going to describe each one and implement 301 redirection as SEO friendly redirection in ASP.NET.
It's used when we want to redirect a website to another with its link popularity and PageRank. SEOs love this kind of redirections. 301 redirect shows that a website has been transferred permanently to new website.
This kind of redirection is not SEO friendly. 302 redirect shows that a website has been transferred temporary to new website. Avoid using this redirection.
These two kinds of redirections are implemented in client or server side technologies. Here I'm going to show it in ASP.NET:
Response.Redirect() uses 302 redirects by default so we can't use it if want to implement 301 redirects.
Using following code we can implement 301 redirects with Response object:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Response.Status = "301 Moved Permanently"
Response.AddHeader("Location", "http://www.nayyeri.net/")
End Sub
That's it! This redirection is SEO friendly and can improve your new website in search engines.
301 Redirects for ASP.NET | The Organic SEO
Oct 31, 2008 6:58 PM
#
Pingback from 301 Redirects for ASP.NET | The Organic SEO
301 Redirects for ASP.NET | The Organic SEO
Nov 24, 2008 11:13 AM
#
Pingback from 301 Redirects for ASP.NET | The Organic SEO
Leave a Comment