0

In our application we do url rewrite for all the pages. For example you have . Recently we changed all the urls to be /adults/about/ or /kids/about/ ... Now all the previous urls like "/about/" will give 404. Is there a way to add 301 redirect and force all the pages like "/about/" to go to "/adults/about/". I found a way but I am not sure it is a good one or it will help in SEO. What I did is added a url rewrite for the "/about/" like the "/adults/about/" and then in the page_Load checked if there is no "adults" or "kids" in the url then redirect to "/adults/about/". The adults and kids are not folders. They just help in differentiating the nav menu.

Sorry if the title is not clear.

Zein Sleiman
  • 254
  • 2
  • 11

1 Answers1

0

Check the URL in Application_BeginRequest in your global.asax file. If the HttpContext.Current.Request.Url matches an old page, do an 301 redirect to the corresponding new page.

You can check this through Regular Expressions for example.

Here is explained how to do a proper 301 redirect.

Community
  • 1
  • 1
magnattic
  • 12,638
  • 13
  • 62
  • 115