. Switch to SSL through redirection

Parts of my site must be a server through SSL. I use only paths (not full URLs) in links, so users stay on SSL when opening links. However, when I use the quick redirect feature, the user is redirected to a non-SSL URL.

Is it possible to indicate that redirection should occur via SSL? It would be better if the redirects were the same as regular links, and did not change between the HTTP and HTTPS protocols.

+4
source share
2 answers

What about a general redirection method? It didn’t work?

from django.views.generic.simple import redirect_to urlpatterns = patterns('', (r'^one/$', redirect_to, {'url': '/another/'}), #etc... ) 

You can also use the simplest way:

 from django.http import HttpResponseRedirect def myview(request): ... return HttpResponseRedirect("/path/") 
+1
source

Sorry to be back on this old post, but I have exactly the same problem. When I go to my swbsite (https://jib.li) via ssl, it redirects it to / home, but without ssl ... I do my redirect as suggested:

  url(r'^$', redirect_to, {'url': '/home/'}) 

Thanks!

0
source

All Articles