日期:2014-05-17 浏览次数:20592 次
public class Redirection : IHttpModule
{
public void Dispose()
{
}
public void Init(HttpApplication context)
{
context.AcquireRequestState += new EventHandler(Process301);
}
private void Process301(object sender, EventArgs e)
{
WebClient client = new WebClient();
string url =HttpContext.Current.Request.RawUrl.ToString().ToLower();
if (url.Contains("images/"))
{
string newurl = "http://photo.xxxx.com/images/";
HttpContext.Current.RewritePath(newurl);
}
}
}