title: Heroku still redirects to https
body: <p>I removed SSL from our site a couple of days ago and have faced a lot of problems. However, most of them have been solved and only one exist: one gets redirected to https even though you put in http.</p>
  
  <p>In Heroku I've removed the SSL app as well as the pointers in PointDNS that pointed to osaka-4635.herokussl.com.</p>
  
  <p>As for now I have the following in PointDNS:</p>
  
  <ul>
  <li>NS pointers from root to dns<strong>x</strong>.pointhq.com</li>
  <li>ALIAS from root to heroku app</li>
  <li>CNAME from www to heroku app</li>
  </ul>
  
  <p>Is something wrong here or may it be something in the backend code that needs to be changed?
  May the problem be at our DNS provider instead of Heroku?</p>
  
  <p>Again, all I want i to remove https.</p>
  
  <p>Thanks in advance!</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Searched in project folder for 'https' and found it in several files where our web adress is hard coded (<a href="https://www.sitename/.." rel="nofollow">https://www.sitename/..</a>.) so I understand that all of this needs to be changed to http. Except for that I found it in the following files (followed by the code).</p>
  
  <p><em>middleware.py</em>:</p>
  
  <pre><code>class RequestSSLMiddleware(object):
      def process_request(self, request):
          if not any((DEBUG, request.is_secure(), request.META.get('HTTP_X_FORWARDED_PROTO', '') == 'https')):
              url = request.build_absolute_uri(request.get_full_path())
              secure_url = url.replace('http://', 'https://')
              return HttpResponsePermanentRedirect(secure_url)
  
  class ResponseSSLMiddleware(object):
      def process_response(self, request, response):
          if not DEBUG:
              if 'Location' in response:
                  if response['Location'][0] == '/':
                      response['Location'] = 'https://' + get_current_site(request).domain + response['Location']
          return response
  </code></pre>
  
  <p><em>settings_base.py</em>:</p>
  
  <pre><code># Honor the 'X-Forwarded-Proto' header for request.is_secure()
  SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
  </code></pre>
  
  <p><em>gunicorn.conf</em>:</p>
  
  <pre><code>secure_scheme_headers = {
      'X-FORWARDED-PROTO': 'https'
  }
  </code></pre>
  
  <p><em>settings.py:</em></p>
  
  <pre><code>SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
  </code></pre>
  
  <p><strong>I guess I have some work in front of me... but for those of you that understands the code, may it be lots of work to change from https to http in this case?</strong></p>