This project is read-only.

Redirect 301 for all my folder to root

Topics: ASP.NET 2.0, Business Logic Layer, Controls, Themes
Nov 11, 2012 at 6:43 PM

time ago I posted my problem 301 redirect from subdirectory to root
Today I added the following function in global.asax and everything seems to work,

    void Application_BeginRequest(object source, EventArgs e)
        HttpApplication app = (HttpApplication)source;
       // HttpContext context = app.Context;
        string thisUrl = app.Request.Url.ToString().ToLower(); 

		if (thisUrl.Contains(""))

		HttpContext.Current.Response.Status = "301 Moved Permanently";
		HttpContext context = app.Context;        
        // Attempt to perform first request initialization

when i write, redirect work fine,

when i write i don't have redirect but i see the post and i dont have error...

very strange...  ... do you think there is something wrong with these lines of code '?