getting *.php to run *.aspx
I am working on a site that has a little flash gadget for which I do not have the source for and cannot change. The flash file is requesting 'file.php' on the server. I need to be able to provide file.aspx's content instead. I've written the following httpHandler:
namespace MyHandler
{
public class UrlHandler : IHttpHandler
{
#region IHttpHandl开发者_如何学Pythoner Members
public bool IsReusable
{
get { return false; }
}
public void ProcessRequest(HttpContext context)
{
string vPath = context.Request.RawUrl;
if (vPath.IndexOf("file.php", StringComparison.OrdinalIgnoreCase) > 0)
{
context.Response.Redirect("file.aspx");
}
}
#endregion
}
}
In IIS i've also mapped the *.php extension to use the .Net ISAPI Module in Handler Mappings. But when I navigate to file.php it just shows a 404 error.
Any help of fixing this, or another solution would be grately appreciated.
Kind Regards
Put the handler in the system.webServer
section as well.
http://msdn.microsoft.com/en-us/library/46c5ddfy.aspx
精彩评论