title: Redirect Middleware not working - Django
body: <p>I created a simple redirect middleware </p>
  
  <pre><code>class RedirectMiddleware(object):
      def urlredirect(self, request):
          path = self.request.build_absolute_uri()
          if "something" in path:
              URL = "http://www.someurl.com"
          else:
              URL = "http://www.otherurl.com"
          return HttpResponsePermanentRedirect(URL)
  </code></pre>
  
  <p>But i doesnt seem to work , it doesnt does anything , and yes i added it on the settings.py, any idea ?</p>