Last post Jun 20, 2017 02:02 AM by Cathy Zou
Jun 19, 2017 01:40 AM|shafaqat309|LINK
I want to write an asp.net page redirect
should always redirect to
about-the-store page exists but we don't want to delete it.
we have multiple stores and every store has the about-the-store page.
I need this redirect happen even if user types the complete about-the-store URL in the browser and it should be a 301 redirect.
This rule would be for stores only, for example rule should only redirect if "mystore" is available in the URL.
There is no limit of how many stores will be in my application.
Jun 19, 2017 01:33 PM|bbcompent1|LINK
You could take advantage of ASP.NET routing. Check this out and let me know if this will work for you:
You might be able to store the routing information in your database, read that into a data table and then match the URL that way to a dynamic routing table; that would support your N number of stores.
Jun 20, 2017 02:02 AM|Cathy Zou|LINK
Do your old page 301 redirects in the Page_Load event.
protected void Page_Load(object sender, System.EventArgs e)
Response.Status = "301 Moved Permanently";
For your canonical redirect you could do similar in the Global.asax file in Application_BeginRequest to detect the non www((non www to www)
HttpContext.Current.Response.Status = "301 Moved Permanently";
For more detailed information, please refer to the following links:
Disclaimer: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found
on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions
you to make sure that you completely understand the risk before retrieving any software from the Internet.