+ Reply to Thread
Results 1 to 2 of 2

Thread: Permanently redirect old page to new page asp.net

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    3

    Permanently redirect old page to new page asp.net

    I have renamed page in my asp.net website. Later I found that old URL of the page was crawled by Google and is resulting in 404. This is not good from SEO perspective. How can I permanently redirect my old page to new page?

  2. #2
    Junior Member
    Join Date
    Oct 2012
    Posts
    7
    You can do this in Application_BeginRequest event of your Global.asax.cs class. Check if request contains old url and then redirect it. see code below:

    Code:
      protected void Application_BeginRequest(Object sender, EventArgs e)
      {
                  if (Request.Path.ToLower().Contains("old.aspx"))
    	      {
                          Response.RedirectPermanent(newPath);
    	      }
    
      }

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts