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
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
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
精彩评论