Search This Blog

Tuesday, January 17, 2012

Django, Force Https on Django Admin in Apache


Encrypt all network traffic going through Django admin pages.
i.e. All pages http://yoursite.com/admin/ANY_PAGES will be redirected to
secure pages https://yoursite.com/admin/ANY_PAGES


Just add a redirect match to your httpd.conf file. For example, in Ubuntu (/etc/apache2/sites-available/your_config_file) you can do:

RedirectMatch ^/admin.* https://yoursite.com/admin

No comments: