views:

32

answers:

2

Hello, i have used URL rewriting using global.asax file. url rewriting is working file on local machine but when i made it online its not working.

void Application_BeginRequest(Object sender, EventArgs e) { var extension = Path.GetExtension(Request.PhysicalPath).ToLower();

if (File.Exists(Request.PhysicalPath))
{
    if (extension == ".html")
    {
        Response.WriteFile(Request.PhysicalPath);
        Response.End();
    }
    return;
}

var path = Request.Path;

if (!Context.Items.Contains("ORIGINAL_REQUEST"))
    Context.Items.Add("ORIGINAL_REQUEST", path);

if (extension == ".html")
{
    var resource = UrlRewriting.FindRequestedResource();
    var command = UrlRewriting.GetExecutionPath(resource);
    Context.RewritePath(command, true);
}

}

url is:ind205.cfmdeveloper.com when you click on about us ,demo,advertise page it will not display. so please let me know is there any IIS setting require,

reply me soon thanks Samir

A: 

Hi Samir,

I work on url rewriting. I don't think it need any setting in IIS as i work in it and i didn't made any changes in url writing by the way you can see these links.hopefully you get any solution from them.

http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx

http://learn.iis.net/page.aspx/496/iis-url-rewriting-and-aspnet-routing/

http://learn.iis.net/page.aspx/517/url-rewriting-for-aspnet-web-forms/

http://www.asp.net/learn/Videos/video-154.aspx

http://www.15seconds.com/Issue/030522.htm

http://urlrewriter.net/

If you got your answer from these links check my answer and also vote it.thanx

Emaad Ali
hi emy, i have already seen these sites but its not my solution.i am not able to identify my problem.i dont think so there is requirement of setting on IIS.but still i am confusing...
Samir
in my opinion you use http://urlrewriter.net/index.php/download this link to download url rewriter and implement it.
Emaad Ali
A: 

I notice that you have .html file that you check for. For html to pass from asp.net processing , you need to declare it (map it) ether on iis ether on web.config

Aristos