Problem in C# .net web application Redirection -


i coded httpmodule , added correctly site give me error when run it:

**the page isn't redirecting

firefox has detected server redirecting request address in way never complete.**

    using system;     using system.web;     using system.net;     using system.text;     using system.io;      namespace commonrewriter     {         public class parseurl : ihttpmodule         {             public parseurl()             {              }              public string modulename             {                 { return "commonrewriter"; }             }              public void init(httpapplication application)             {                 application.beginrequest += new eventhandler(application_beginrequest);                 application.endrequest += new eventhandler(application_endrequest);             }               private string parseandreapply(string texttoparse)             {                 string final = null;                  if (texttoparse.contains(".") && texttoparse.contains("example.com"))                 {                     string[] splitter = texttoparse.split('.');                     if (splitter[0].tolower() != "www" &&(splitter[2].tolower()).contains("blog"))                     {                         final = ("www.example.com/blog/?tag=/" + splitter[0]);                     }                     else { final = texttoparse; }                 }                 else { final = texttoparse; }                  return final;             }              void application_beginrequest(object sender, eventargs e)             {                 httpapplication application = (httpapplication)sender;                 httpcontext context = application.context;                  string req = context.request.filepath;                 context.response.redirect(parseandreapply(req));                 context.response.end();             }               void application_endrequest(object sender, eventargs e)             {              }              public void dispose() { }          }     } 

every begin request redirecting, same url. need check make sure redirection necessary before calling context.response.redirect().


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -